Hal Robson-Kanu scored the winner as Wales beat Slovakia 2-1 in their first ever match at a European Championship finals.
The substitute carved his name into Welsh football history with a low strike nine minutes from time, after Ondrej Duda (60) had cancelled out Gareth Bale's first-half free-kick in Bordeaux.
It means Wales tasted victory in their first match at a major international tournament since the 1958 World Cup and are now in a strong position to qualify from Group B ahead of clashes with England on Thursday and Russia next Monday.
Chris Coleman had suffered a blow ahead of the game as first-choice goalkeeper Wayne Hennessey woke up with a back spasm meaning 22-year-old Liverpool goalkeeper Danny Ward made his first international start in goal.
And he almost conceded just four minutes into the match when Slovakia playmaker Marek Hamsik showed sublime skill to run 30 yards into the area and produce a low left-footed shot which beat the Wales goalkeeper - only for Ben Davies to slide in and make a last-ditch clearance off the line.
Just six minutes later, Wales took the lead thanks to the left foot of Bale. Jonny Williams was needlessly tripped by Patrik Hrosovsky 30 yards out and the Real Madrid star stepped up to curl the ball over the wall and into the net.
Bale rushed to the Wales bench to joyfully celebrate a landmark goal, but Slovakia will ask questions of goalkeeper Matus Kozacik, who took a step to the left just before the ball was struck and was beaten far too easily.
Chris Coleman's side might have had a penalty on 32 minutes when Martin Skrtel stepped across and appeared to bundle Jonny Williams over with his elbow inside the area. However, nothing was given - even though one of the extra officials was standing two yards from the incident.
Wales continued to control the game after the interval with a firm Bale header forcing a fine save from Kozacik to his right with 58 minutes gone.
That prompted Slovakia manager Jan Kozak to make a double substitution with Duda and Adam Nemec introduced for Hrosovsky and Michal Duris.
It proved to be an inspired move as Duda scored with his very first touch.
The goal was engineered by a fine run from Robert Mak, who cut in from the right and beat Aaron Ramsey and David Edwards before setting up the substitute to strike low between two defenders and beyond Ward from near the penalty spot.
Slovakia seized the initiative as Juraj Kucka forced a save from Ward before Coleman made an inspired double substitution of his own on 69 minutes as Robson-Kanu and Joe Ledley replaced Jonny Williams and Edwards.
Robson-Kanu almost created a goal with his first real involvement, crossing for Ramsey from the right, but the midfielder's header from inside the six-yard box went over the bar.
But the substitutes were both involved in a goal that will be long remembered by Wales fans.
In the 81st minute, Ledley played a superb long pass to Ramsey, who nicked the ball past Skrtel and into the path of Robson-Kanu who scuffed the ball through the legs of Durica and beyond the goalkeeper.
The final touch appeared to come off his shin, but that mattered little as the Wales players dived on top of the goalscorer in wild celebrations by the corner flag.
Nemec might have denied Wales with four minutes left, but his header clattered the post, while both Bale and Ramsey wasted late opportunities to put the game beyond doubt.
But Wales held on to earn a win that could see them extend their stay at their first major international tournament in 58 years beyond the group stage.
Wales: Ward, Chester, Ashley Williams, Davies, Gunter, Allen, Edwards, Ramsey, Taylor, Jonny Williams, Bale.
Used subs: Robson-Kanu, Ledley, Richards
Slovakia: Kozacik, Pekarik, Skrtel, Durica, Svento, Kucka, Hrosovsky, Hamsik, Mak, Duris, Weiss.
Used subs: Duda, Nemec, Stoch
Man of the match: Joe Allen