Alan Dunne's superb late goal enabled Millwall to beat non-league Havant and Waterlooville at Portsmouth's Fratton Park and reach the FA Cup second round.
The 2004 FA Cup finalists took the lead in the opening five minutes when Ben May slotted home from close range after a run and cross from Chris Hackett.
After hitting the bar, Mo Harkin provided the cross for Rocky Baptiste to equalise just before the hour.
But Havant had no answer to Dunne's stunning 25-yard shot on 71 minutes.
Havant and W: Gore, Michael Warner, Jordan, Byles, Gregory (Holdsworth 74), Harkin (Watkins 82), Collins (Simpson 82), Taggart, Poate, Pacquette, Baptiste.
Subs Not Used: Sharp, Howells.
Booked: Jordan, Pacquette, Poate, Byles.
Goals: Baptiste 57.
Millwall: Pidgeley, Senda (Ross 46), Shaw, Robinson, Whitbread, McInnes (Mawene 90), Elliott, Dunne, Hackett, May (Byfield 48), Zebroski.
Subs Not Used: Day, Hubertz.
Booked: May, Hackett, Zebroski.
Goals: May 6, Dunne 71.
Ref: R Lee (Essex).