Andorra 1 Wales 2: Bale saves the day for unconvincing Wales
With two automatic qualification spots and one play-off place up for grabs in each group, Wales have rarely had a better chance of reaching a major tournament for the first time since 1958.
But Chris Coleman's side suffered an early scare after falling behind against an Andorra side looking to add to a meagre tally of five points from 82 qualifiers since being ratified as a FIFA nation in 2000.
Their hopes were thwarted by Bale, though, as the Real Madrid winger scored twice - his winning effort a curling a free-kick that came just nine minutes from time to spare Wales' blushes in the Group B clash.
Captain Ildefons Lima scored the hosts' first competitive goal in four years early in the first half by converting a penalty to give Andorra, ranked 199th in the world, hope of claiming only the second competitive victory in their history.
Bale soon levelled with a header and, just when it appeared that Andorra were going to hold on for a famous point, the 25-year-old produced a moment of quality that broke the underdogs' hearts and served as another example of why Real paid a world-record transfer fee for his services.
The visitors enjoyed the better of the opening exchanges but surprisingly fell behind in the sixth minute through Lima's spot-kick.
Centre-back Lima stepped up to convert from 12 yards after Neil Taylor had been dubiously adjudged to have brought down Ivan Lorenzo.
Wales immediately reassumed their dominance as they pressed to find a quick leveller, Bale offering a warning sign as to his threat in the air as he headed narrowly over the crossbar from Joe Allen's corner.
Andorra did not learn from that near-miss, though, and were punished by Bale after 22 minutes when he towered above the home defence to glance home Ben Davies' perfectly placed left-wing cross.
But Coleman's men were far from impressive going forward and only when Bale got into promising areas were they really able to trouble a surprisingly resolute Andorra defence.
Bale forced a good save from Ferran Pol with a curling free-kick 12 minutes into the second half before seeing an excellent cross headed wide by striker Andy King.
The opportunities continued to come for former Tottenham star Bale, who saw a header acrobatically cleared off the line by midfielder Josep Ayala in a fitting demonstration of Andorra's heroic defensive effort.
Yet that effort proved to be for nought as Bale fired home from a set-piece at the second time asking after seeing his first effort saved by Pol, only for the referee to demand a retake due to encroachment in a costly error by Andorra striker Gabi Riera.