Gareth Bale saved Wales from severe embarrassment in Andorra as Chris Coleman's side began their Euro 2016 campaign with a nervous 2-1 victory.
Andorra, ranked 199th in the world and without a goal in competitive football for four years, stunned Wales inside five minutes when they were awarded a controversial penalty.
Ildefons Lima sent Wayne Hennessey the wrong way from the spot and one of football's greatest ever upsets looked possible.
But Real Madrid star Bale, so often as he has done before, dragged Wales out of trouble and equalised with a fine header from Ben Davies' 22nd minute cross.
Wales were living on their nerves as they chased a winner against opponents whose tackling was often rash in the extreme, but Bale settled those worries when he curled home a magnificent free-kick nine minutes from time.
The 3G artificial surface had generated plenty of headlines in the build-up to the game and it was easy to see why as it was very difficult to play on.
But Wales fashioned the first chance inside 45 seconds when Aaron Ramsey found Chris Gunter down the right with a raking pass and the full-back forced Andorra goalkeeper Ferran Pol into a smart save at the near-post.
Then came that Andorra penalty, awarded by the fifth official behind the goal-line after Neil Taylor was adjudged to have pushed Cristian Martinez.
Wales were visibly shocked but Bale's 13th goal for his country settled Wales and Ramsey cut into the area to send Andorra alarm bells ringing, the hosts just managing to smother the danger.
The former Tottenham and Southampton star was dropping deep trying to influence matters but Andorra were not overawed and in burly striker Gabriel Riera had a focal point for crosses swung into the Welsh box.
Wales struggled to penetrate a tight Andorra defence but the same Davies-Bale combination which had worked for the goal almost paid off again close to half-time but Bale was eased off the ball.
Coleman's side came out with more intent at the start of the second half and Andorra had to deal with a couple of dangerous set-pieces.
Coleman sent on Joe Ledley for Simon Church after 62 minutes and Wales were sending men forward in search of a second while being at risk of being exposed on the break.
Ashley Williams almost capitalised on a Bale cross but he was denied by brave Andorra defending while claims for a penalty for handball were waved away by Slovenian referee Slavko Vincic.
Wales forced plenty of set-pieces even if chances were not in plentiful supply.
But Andorra escaped when Ramsey's corner caused panic in their penalty area and Bale's back header was cleared off the line with Ledley bearing down on the dropping ball.
There was a moment of real concern at the other end when Williams hesitated and scuffed his clearance and Wales made the most of their good fortune after 81 minutes.
Bale was felled to win a free-kick which was just about saved by Pol.
But Bale was given a second chance as Riera had raced out too quickly and this time the winger smashed his effort home, the ensuing pitch invasion from Wales fans probably borne out of relief as much as joy.