Radja Nainggolan put Belgium ahead with a thunderous 25-yard strike but Wales captain Ashley Williams headed in from a corner to equalise in a breathless first half littered with chances at both ends.
Welsh celebrations reached stratospheric levels when Hal Robson-Kanu, a striker without a club, gave them the lead with a divine turn and finish.
After withstanding late Belgium pressure, Wales sealed victory through a header from substitute Sam Vokes that set up a semi-final against Portugal and a mouth-watering duel between Real Madrid team-mates Gareth Bale and Cristiano Ronaldo.
Wales manager Chris Coleman had described the last-eight tie as Wales' biggest match since their 1958 World Cup quarter-final defeat by Brazil, their only previous appearance in the knockout stages of a major tournament.
His players rose to the occasion wonderfully, recovering from a difficult start to claim what must rank as the greatest win in Welsh football history.
ltimate team display creates history
Absent from major tournaments for 58 years, Wales have not only ended a barren half a century but propelled Welsh football into unchartered territory.
Previous Welsh sides have claimed iconic results, such as a 2-1 win over Hungary at the 1958 World Cup, a 1991 victory against then world champions Germany and a qualifying triumph against Italy in 2002.
However, those were in isolation and failed to propel Wales on to greater achievements.
Former Wales striker Dean Saunders said: "Heart, desire, determination, organisation - there is a plan that has been put in place and it shows what you can achieve - you start thinking - is our name on it?"
Bale has been a key figure in Wales' success at Euro 2016, scoring three times in the group stages, but this victory highlighted the team spirit that Coleman and his side have spoken of throughout their time together in France.
The Real Madrid forward worked industriously throughout, but his efforts were eclipsed by others such as Williams, who scored despite a shoulder injury which made him a doubt for the game.
Aaron Ramsey was Wales' creative heart - setting up two of the three goals - and it is a crushing blow that both the Arsenal midfielder and Ben Davies will miss the semi-final after picking up a second tournament booking.
And then there was the display from Robson-Kanu, a player who has been inspired by Wales' historic run in this tournament.
Robson-Kanu's moment of genius
Belgium would have seen Bale as the obvious threat going into this game, but it was a free agent released by Reading who gave his side a foothold on 55 minutes.
Coleman's men had to weather several periods of heavy Belgian pressure, but they took the lead in spectacular fashion against a side ranked second in the world, playing only 10 miles from the Belgian border.
A neat move saw Ramsey pass to Robson-Kanu, who bamboozled the defenders surrounding him with a graceful turn which allowed him the space to calmly finish.
There was a symbolism to the goal as Robson-Kanu - released by a Championship side - swept his shot past Chelsea goalkeeper Thibaut Courtois.
Former Wales forward John Hartson said: "If I was a chairman of a Premier League club I would be making Hal Robson-Kanu my next signing. What a goal. He sent Thomas Meunier for a cup of tea and a piece of toast with that turn."
This was a goal which embodied Wales' odds-defying run at Euro 2016, after languishing as low as 117th in the world rankings in 2011.