The Kazakh side came from a goal down at the break to overcome Manchester United's fledglings.
Article top media content
Ole Gunnar Solskjær's side suffered their first Group L defeat thanks to a second-half turnaround in Astana.
The manager named United's youngest ever line-up for a European game and their youthful exuberance had an early impact as Jesse Lingard fired in for the dominant visitors.
Astana clawed their way back into the contest, though, and two goals in eight second-half minutes ended their five-match losing run in the competition.
Dmitri Shomko clinically levelled in the 55th minute before Di'Shon Bernard turned Antonio Rukavina's cross past his own goalkeeper to give the home side a famous victory.
Eugene Ravdin, Astana
No doubt it is a historic result for Astana because a win against Manchester United is always something to celebrate. There is a Russian football saying "the game is forgotten, the result remains" and players will be happy to be reminded of that. They have redeemed a campaign that had fans asking questions.
Matthew Howarth, Manchester United
Despite appearing to run out of steam as the game wore on, United can hold their heads high. It was a valuable experience for the Red Devils' youngsters, many of whom are likely to be given another opportunity to shine when AZ visit Old Trafford on Matchday 6.
State of play
- Astana are out of contention
- United are through and their final group game against AZ will decide first place.
Astana goalscorer Dmitri Shomko:
"It is not every season that we play such a great team. It is nice we won tonight. [I will be telling my grandchildren], you know guys a while ago I scored against Manchester United though it does not matter who scored really. The most important thing is that we won."
Astana defender Antonio Rukavina:
"It is always tough to play against a big team like Manchester United. Today we had fighting spirit. We showed that even when we concede a goal against such a big team as Manchester United, we can still play football and beat them. In our previous matches we put our heads down after conceding. It is one of the top three or four wins in my career. I won against Barcelona, Real Madrid, Atlético Madrid and now against Manchester United."
Jesse Lingard, United forward:
"We dominated the first half, but could have managed the period at the start of the second half better. It's not an easy place to come. They had their tails up and the fans were backing them, but our mentality was right and we stuck together. We want to finish top of the group. Going into the [Alkmaar] game we can be confident we'll get the three points. Tonight was a different environment, everyone had to adapt."
Ethan Laird, United defender: "I was buzzing when I got told [I was starting]. It's a disappointing result, but we'll learn from it and come back better. When you have the likes of Jesse alongside you, it always gives you confidence. I just got on with the game. We'll learn from this, but it's great that we got the opportunity."
• Astana end a run of five consecutive defeats in this competition.
• United lose for the first time in 16 games in this competition.
• United concede for the first time in seven UEFA Europa League games.
• United's starting XI was their youngest ever for a European game.
• Lingard ends his run of 28 games without scoring for United.
• United lose a European match after taking the lead for the first time in 25 games (W20 D4) since losing 2-1 at Midtjylland in the last 32 in February 2016.
Astana: Erić; Rukavina, Logvinenko, Postnikov, Shomko; Maevski, Beysebekov; Rotariu, Sigurjónsson, Murtazayev (Janga 90); Khizhnichenko (Pertsukh 85)
Manchester United: Grant; Shaw, Tuanzebe, Bernard, Laird; Garner (Ramazani 84), Levitt; Chong (Bughail-Mellor 65), Gomes (Galbraith 88), Lingard; Greenwood