Craig Bellamy scored a brace and forced an own goal as Wales confounded their critics with a fine win away in Trnava.
Ledley gets thanks after his pass sent Bellamy clear for Wales' third
Marek Mintal gave Slovakia an early lead, controlling and firing home in one swift movement, but Freddy Eastwood equalised from Joe Ledley's cross.
Then Bellamy scored twice in quick succession, each time racing clear from through balls by Eastwood and Ledley.
Mintal pulled one back, but Jan Durica's own goal and a late breakaway strike by Simon Davies sealed the win.
Wales have not made a habit of winning away from home, their last in competition coming against Northern Ireland almost two years ago.
But this result at the Anton Malatinsky Stadium - against a team ranked 35 places above them - showed that a corner may have been turned by John Toshack's youthful side.
It was the first time Wales have scored five goals in an away match in 11 years.
Although it is probably too late for Wales to qualify for Euro 2008 from this Group D, they can have significant influence on who does if they continue to play like this.
The result leaves Wales fifth after eight games, level on 10 points with Slovakia who have a better goal difference.
Wales suffered the late loss of defender Lewin Nyatanga, as the 19-year-old was flown home in the afternoon before the match with a back problem.
It meant that Peterborough's Craig Morgan stepped in for his third cap, forming a defensive central back-three with Danny Gabbidon and James Collins in a 5-3-2 formation.
Vratislav Gresko caused an early panic in the Wales defence, as the former Blackburn player cut in from the left and fired in a cross that pinballed dangerously across the area.
Despite that early warning Sam Ricketts, in the right wing-back position, again stood off Gresko who this time measured an aerial cross that led to Slovakia's opener on 12 minutes.
Collins did well to get his head to the ball but was unable to clear and, as Ledley dawdled, Mintal had time to bring the ball down and fire into the top-left corner of Wayne Hennessey's goal.
The Wolves stopper denied Mintal a second soon after, then pulled off a full-length diving save as Marek Cech fizzed in a 25-yard shot after a corner had been knocked back to him.
But any thoughts that a repeat of last October's 5-1 beating in Cardiff might be on the cards was dismissed as Wales hit back with an equaliser after 22 minutes.
Bellamy collected a good ball into feet and picked out Ledley's burst into the left of the Slovak box.
The Cardiff youngster spotted Eastwood at the back post, who got enough contact to arc the ball into the net for his second international goal in just his third Wales appearance.
Ledley had just been switched with Gareth Bale from left wing-back to left midfield and Wales looked far more solid down that flank as a result.
If that partnership looked better, the new strike pairing of Bellamy and Eastwood suddenly blossomed into life to give Wales the lead.
Bellamy had missed Saturday's 2-0 loss to Germany to be at the bedside of his ill newly-born daughter, but made up for lost time as Eastwood's pass caught the Slovak defence flat.
There was still work to be done but Bellamy motored goalward before clipping a cool left-foot shot back across Stefan Senecky into the far top corner.
Seven minutes later the West Ham forward struck again with an even better goal, as Ledley robbed possession in midfield before clipping a lofted pass forward.
Bellamy gathered in his stride and this time powered a left-footer into the near top corner.
Hennessey ensured that two-goal cushion stayed intact for half-time, as he just tipped a late shot from Filip Holosko onto the bar.
Marek Mintal claimed both of Slovakia's two goals
Slovakia applied some early pressure but Wales nearly stretched their lead with a swift counter-attack.
A ball out of defence found Bellamy streaking up the left wing, who just failed to find Eastwood's forehead as the Wolves hitman burst into the box.
But Slovakia produced a fine counter of their own to pull a goal back, Cech driving into the heart of the Wales defence before playing in Mintal to score his second.
The end-to-end nature of an enjoyable game - unfortunately played in front of a sparse crowd - continued and Bellamy almost claimed a hat-trick as his speculative cross hit the back post.
Wales boss Toshack opted to keep what they had by replacing Eastwood with defensive midfielder Carl Fletcher.
But Bellamy was just as happy in the lone role up front and another break and cross forced Durica, who had been given a torrid night, to turn into his own net.
Slovakia came gamely on in search of a way back after that 78th-minute blow, but Wales' defence held their nerve while Hennessey continued to impress behind them.
Davies sealed things with a last-minute strike, again sparked from a thrilling run and cross by that man Bellamy, to ensure a glowing Wales win.
Slovakia: Senecky, Gresko (Zofcak 64), Klimpl, Durica, Cech, Hamsik, Petras, Sapara, Mintal, Sestak (Obzera 46), Holosko.
Subs Not Used: Kuciak, Brezinsky, Strba, Szabo, Sebo.
Goals: Mintal 12, 57.
Wales: Hennessey, Ricketts, Gabbidon, Morgan, James Collins, Bale, Davies, Robinson, Ledley (Vaughan 85), Bellamy, Eastwood (Fletcher 73).
Subs Not Used: Coyne, Crofts, Evans, Edwards, Earnshaw.
Goals: Eastwood 22, Bellamy 34, 41, Durica 78 og, Davies 90.
Ref: Laurent Duhamel (France).