Swansea City slipped to their first defeat in 18 games after being caught out straight from the kick-off.
Lewis Grabban headed home after just 34 seconds and when Jay Simpson made it 2-0 in the 70th minute, Millwall looked home and dry, but a penalty from Jason Scotland three minutes later made for a frantic finish.
Scotland passed a late fitness test so the Swans were unchanged as they looked to equal the club record of 19 games unbeaten achieved during the 1970-71 season.
The visitors silenced the home fans with that early goal and they should have doubled their lead in the sixth minute when Gary Alexander's shot was fumbled at the near post by Dorus de Vries, but the ball was hacked clear.
In the 26th minute a Lions breakaway left Grabban in the clear, but he fired wide of the far post as the Swans left themselves wide open to the counter-attack.
Swansea missed a great chance ten minutes into the second half when Rhys Evans cleared a shot from Andy Robinson with his feet. Darren Pratley ran in for the loose ball, but managed to scoop it over the bar on just three yards out.
Febian Brandy replaced Kristian O'Leary in the 64th minute as the Swans tried to increase their attacking options, but the visitors were now able to exploit the three-man rearguard.
In the 70th minute they did just that as Simpson took advantage of a slip by Alan Tate to roll the ball into the net.
Three minutes later Ali Fuseini brought Brandy down inside the area for Scotland to ram home his 16th league goal of the season.
Guillem Bauza came on with five minutes remaining, but Millwall held out for a deserved victory.