In worryingly similar fashion to the opening goal conceded at QPR on Sunday, United were again troubled by an early corner and Aaron Holloway smashed home to give Fleetwood a 13th-minute lead.
Leeds were heading for an early exit but the excellent Marcus Antonsson saved the day by hammering home an equaliser in the 90th minute after a second-half of incessant Whites pressure.
That pressure continued into the added period and after Antonsson earned Leeds a 94th-minute penalty, Chris Wood calmly fired home to leave United heading for the second round.
But Fleetwood had other ideas and with just nine minutes remaining, substitute Ashley Hunter raced onto Jonsson’s right flank cross to hammer the ball home and make it 2-2.
The game would be decided on penalties and United’s five were faultless as Wood, Antonsson, Alex Mowatt, Kalvin Phillips and Pablo Hernandez all converted.
Fleetwood also scored their first four but Eggert Jonsson proved the odd one out as Green produced a fine save to his left hand side to put United in the next round.
Whites head coach Garry Monk made five changes to the side that lost 3-0 at QPR on Sunday with new signing Pablo Hernandez and Hadi Sacko making their full Leeds debuts.
Liam Cooper also returned from injury at centre-back while there were starts for Kalvin Phillips, Lewie Coyle
But United were handed an immediate let off when Devante Cole latched on to a misplaced header from Liam Cooper and fired just wide from the edge of the area.
For United, Kalvin Phillips then fired over the stand from 30 yards out and the Whites then began to pressure the hosts with Pablo Hernandez and Hadi Sacko looking particularly bright.
But Fleetwood were more than matching their hosts and the Cod Army struck the first blow to take a 13th-minute lead as again United conceded from a corner.
The ball was initially cleared but a second cross from the right flank again had United at sixes and sevens and when Lewie Coyle failed to clear, Aaron Holloway needed no second invitation to thump the ball home into the bottom left corner.
The cup ‘shock’ was on but Hernandez continued to look sharp and the Spaniard squandered an immediate chance to level when firing over the bar from ten yards.
But United’s Ronaldo Vieira was then booked for taking down David Ball and from the corner that followed that free-kick, Kyle Bartley was forced to make a crucial headed goalline clearance from a Holloway effort that had Rob Green beaten.
Leeds attempted to rally through Kemar Roofe whose low shot was tipped wide but at the other end another Fleetwood corner caused more mayhem as Eggert Jonsson headed just wide.
Roofe and Chris Wood then both got into good positions in the area before being dispossessed for corners which were cleared.
Wood then failed to connect with a diving header from an inviting cross from Hernandez as United began to build some pressure but the final few minutes of the first half were end to end.
For Fleetwood, the pacy Cole raced through and threatened to bear down on Green’s goal before conceding a foul which ended the attack while at the other end a Roofe cross failed to find Wood before a decent shot from Roofe was parried away by Chris Neal.
But Fleetwood took their 1-0 lead into the interval, during which Monk swapped Cooper for Sol Bamba.
United began the second half much better than they started the first and after seven minutes of pressure an inviting Charlie Taylor cross was headed just over by Wood.
Then, just before the hour, Roofe won a free-kick on the edge of the area but then curled his effort over the bar.
But seconds after coming on, Fleetwood sub Ashley Hunter went agonisingly close to doubling the home side’s lead when firing just over after latching on to Ball’s cross.
Leeds hit back through two wild efforts from Sacko - one of which cleared the stand and headed for the sea - after which the midfielder was subbed for Alex Mowatt.
The Whites continued to apply the pressure and Wood’s left flank cross gave Hernandez a chance but his control let him down before Coyle fired an effort from range which was well held by Neal.
Roofe then fired a fine curling effort from all of 25 yards out that went narrowly wide.
Moments later, a zipped in cross from Taylor found Wood who powered an effort just wide under pressure from the home defence.
Monk then made his final change when bringing on Marcus Antonsson for Vieira with 14 minutes remaining, after which Kyle Bartley was booked for a late foul on Bobby Grant that had the home fans calling for a red.
But Leeds continued to dominate and after a Kalvin Phillips effort was deflected wide, Neal produced a stunning save to tip a stinging Hernandez drive around the post.
Then, with just one minute remaining, Wood squandered a golden chance when scuffing wide from six yards out after Roofe’s lay off.
But as the clock passed the 89th minute Leeds finally drew level when Antonsson turned on a sixpence to hammer home a low cross to spark mass celebrations in the away end.
United were hugely on top and were handed five minutes to win the game in normal time and nearly did when Mowatt connected with Antonsson’s cross but Neal brilliantly tipped the ball wide.
His save took the game to an added 30 minutes which Leeds immediately began on the front foot.
And within just four minutes of the restart United took the lead through a Wood penalty, awarded for a foul on the excellent Antonsson.
There were few complaints about the foul and Wood showed a cool head to stroke the ball home to Neal’s right hand side.
Roofe then fired just wide as Leeds chased a killer third goal and the Whites looked to be finally cruising through to the second round.
But with just nine minutes of extra time remaining, Fleetwood produced a sting in the tail when United failed to deal with Jonsson’s right-sided cross that Ashley Hunter slammed home from the edge of area past Green.
The game was heading to penalties but Mowatt had an opportunity to make it 3-2 when ghosting into the area with three minutes left before blasting his effort over the stand.
But it was Fleetwood who twice went close to bagging a last gasp normal time winner, first when Hunter’s powerful shot was deflected just over and then when Cian Bolger’s fierce effort from a corner was desperately scrambled off the line.
But a thrilling game would be decided on penalties and after being criticised for his role in United’s first conceded goal at QPR on Sunday, Green made amends to put Leeds into the next round. Phew.
Fleetwood Town: Neal; McLaughlin,Bell, Jonsson, Eastham, Ryan, Amadi-Holloway (Hunter 60), Ball (Grant 71), Bolger, Nirennold, Cole. Subs: Cairns, Pond, Kip, Duckworth, Haughton.
Leeds United: Green, Coyle, Bartley, Cooper (Bamba 45), Taylor, Phillips, Vieira (Antonsson 76), Hernandez, Sacko (Mowatt 65) Roofe, Wood. Subs: Turnbull, Denton, Bamba, Grimes, Dallas.
Referee: D Coote.
Attendance 3,326 (Leeds 1,325).
Have you downloaded the free YEP app available on Android and iphone?