All hope seemed lost at 2-0 down - 3-1 on aggregate - after 10 minutes and later at 3-1 behind on the night and 4-2 adrift over the two legs, but the hosts dug deep and produced a remarkable turnaround which saw Dejan Lovren score a dramatic winner.
A 4-3 win carried Liverpool through 5-4 on aggregate.
Manager Jurgen Klopp's assertion back in November that "we decide when it is over" rang true as his players, while not of the 2005 Istanbul vintage, gave every part of their being to put them into the Europa League semi-finals.
Henrikh Mkhitaryan and Pierre-Emerick Aubameyang put the visitors ahead early on, cancelling out Liverpool's away goal in Germany, before Divock Origi's fourth goal in his last three games offered some hope.
Marco Reus appeared to have extinguished hopes but Mamadou Sakho and Lovren, both central defenders, proved to be the unlikeliest of heroes on a night when Klopp's side came of age.
Dortmund boss Thomas Tuchel had promised to attack with impunity and score "two, three or four goals" and his side carried out his instructions to the letter only to be stung so painfully.
In a blistering start which left their hosts shell-shocked, Dortmund looked to be sending Liverpool out of the competition with the sort of football on which they have made their name.
Liverpool lost possession on their left in Dortmund's half and the German side countered. Aubameyang's volley from Gonzalo Castro's cross was worthy of a goal but Simon Mignolet saved well, only for Mkhitaryan to fire home the rebound.
With the away goal cancelled out, Dortmund went for the jugular, with another swift counter-attack seeing a brilliant pass from Reus in behind Sakho superbly converted with ferocious power by Aubameyang.
Liverpool took a while to recover but they responded encouragingly with the Kop's new hero Origi having three chances, Roberto Firmino heading wide and Adam Lallana completely fluffing his shot in front of goal.
However, twice Aubameyang could have finished the tie before half-time as he missed Lukasz Piszczek's cross in the six-yard box and then scuffed wide a pass from Reus.
The famous old ground, which has seen many a glorious European night, shook to its century-old foundations.
Dortmund had one final chance to snatch it with the last kick of the match but substitute Ilkay Gundogan curled it just wide and once again there was an explosion of joy and relief.
At the final whistle Klopp lined up his players in front of the Kop to take the applause of a crowd who had more than played their part and the plaudits were well deserved both on and off the field.
Klopp told team to make history
Liverpool goalscorer Divock Origi revealed Jurgen Klopp encouraged his players to make history before they mounted their stunning comeback to beat Borussia Dortmund and reach the semi-finals of the Europa League.
Liverpool got off to a horrible start as Dortmund scored twice in the opening nine minutes to leave Liverpool needing three.
After Origi pulled one back early in the second half, Dortmund scored again to seemingly end the tie, but Philippe Coutinho, Mamadou Sakho and Dejan Lovren had other ideas, with Lovren's stoppage-time header for a 4-3 win sealing a remarkable comeback.
Origi told BT Sport: "It was very special. At half-time, the coach said we had to create the moment where we could tell our grandchildren, our children about, make a special night for the fans.
"We believed. I think when we scored the first goal we all felt it could be a special moment."
Lovren said of scoring the winner: "It's an amazing feeling. I think it was one of the best games of the last two or three years. We never stopped believing in ourselves. We said at half-time we had nothing to lose, we just had to believe. It was a great effort from everyone."
Henrikh Mkhitaryan and Pierre-Emerick Aubameyang had put Dortmund 2-0 up inside the opening 10 minutes with Liverpool appearing shell-shocked, and Lovren had to stop himself swearing when asked about the start.
"Of course we didn't expect a start like this, it was a sh... start, but we all showed character and never stopped believing. Nothing is over."
Sakho added: "The most important thing today was the team played with heart and the fans never, never leave. They always shout together. This is a win for the Liverpool country."
Manager Klopp said: "It's difficult to explain. It was a wonderful, wonderful night. The game was strange from the beginning.
"When we brought on Joe Allen and Daniel Sturridge, we gave the message to show character. If we lose, we don't care but we have to show character and okay, they did a lot more than that.
"It was brilliant. I think that's what European football can be at its best. It was a wonderful experience and it's hard to believe it really happened."
SIMON MIGNOLET: Unlucky for Dortmund's first goal, could do little about the second and was exposed for the third, but otherwise had few shots to deal with. 6/10
NATHANIEL CLYNE: Made some good runs down the right as Liverpool pushed but got caught upfield. 6
DEJAN LOVREN: Found it tough to hold back Dortmund in the early stages but showed great commitment and grabbed dramatic winner. 7
MAMADOU SAKHO: Caught out for Dortmund's second goal and struggled to repel the visitors despite some strong tackles, but late goal set up grandstand finish. 7
ALBERTO MORENO: Caught out for first goal and badly sliced a good chance to pull a goal back into the crowd. 5
JAMES MILNER: Tried to be forceful through the middle and out on the right but was unable to take command. 6
EMRE CAN: Also had some uneasy moments as Dortmund attacked but showed some good touches going forward. 7
ADAM LALLANA: Linked well with Origi but embarrassingly fluffed one good chance to pull a goal back. 6
ROBERTO FIRMINO: Briefly looked up for the challenge as Liverpool tried to fight back at 2-0 but was unable to sustain his promise. 6
PHILIPPE COUTINHO: Loose pass led to Dortmund's opener but thereafter was a bright spark in the Liverpool attack and took his goal very well. 8
DIVOCK ORIGI: Scored a fine goal and showed excellent movement throughout both to get into scoring positions and to win back lost possession. 9
JOE ALLEN (for Lallana, 62): Gave Liverpool more bite in midifeld. 7
DANIEL STURRIDGE (for Firmino, 63): Provided more attacking threat but chances did not come his way. 6
LUCAS (for Can, 80): Gave Liverpool fresh legs for their final push. 7
ROMAN WEIDENFELLER: Largely untested but was caught out for Origi's goal and could not prevent Coutinho's. 6
LUKASZ PISZCZEK: Composed figure in defence and made some strong forward runs. 7
SOKRATIS PAPASTATHOPOULOS: Organised and dangerous when getting forward. 6
MATS HUMMELS: Underlined his class by bringing the ball out and then sliding in a fine ball for Reus' goal. 7
MARCEL SCHMELZER: Was the busier of the full-backs defensively but Liverpool were unable to make the most of their attacks down the right. 6
GONZALO CASTRO: Showed good vision to keep Dortmund moving and whipped in delivered some dangerous balls. 7
JULIAN WEIGL: Kept Dortmund ticking over and also kept tight to Milner at times. 7
HENRIKH MKHITARYAN: A danger to Liverpool whenever in possession, lively from the start. 8
SHINJI KAGAWA: Worried the Reds repeatedly with his runs and good link-up play. 7
MARCO REUS: Superb run and pass to set up Aubameyang goal, got on the scoresheet himself and showed fine technical ability. 8
PIERRE-EMERICK AUBAMEYANG: Had threatened before he scored Dortmund's second with a thunderous strike, underlining why he is so highly rated. 8
MATTHIAS GINTER (for Kagawa, 77): Unable to make an impression as Liverpool roused themselves in latter stages. 6
ADRIAN RAMOS (for Reus, 83): Could not repel the late Liverpool onslaught. 5
ILKAY GUNDOGAN (for Castro, 83): Reported Manchester City target appeared too late to make an impression as Liverpool pressed. 5
German media reaction
Borussia Dortmund suffered Europa League heartbreak at the hands of Liverpool, prompting outpourings of emotion from the German club and media.
The Bundesliga side's Twitter account was highly entertaining during Liverpool's astonishing 4-3 comeback win at Anfield on Thursday, which gave the Reds a 5-4 aggregate victory and set up a semi-final meeting with Villarreal.
When Pierre-Emerick Aubameyang put the visitors 2-0 up on the night inside 10 minutes, Dortmund gleefully tweeted 'Not bad'.
Although the Reds pulled one back through Divock Origi, when Marco Reus restored a two-goal advantage just before the hour the German club tweeted an image of him looking smug.
Reus looked less happy in their tweet for the next goal, Philippe Countinho's low finish, and Mamadou Sakho's headed equaliser then prompted 'No. No. No.' on Dortmund's Twitter account.
Dejan Lovren's injury time winner resulted in the same response, which was retweeted 13,000 times.
The German media also reacted to the stunning result for Jurgen Klopp against his former club.
Die Welt used the headline 'Jurgen Klopp dealt Dortmund a bitter lesson', Suddeutsche Zeitung went with 'Klopp hurricane sweeps BVB away' and Frankfurter Allgemeine Zeitung with 'Klopp destroyed BVB's title dream'.
Perhaps the sweetest headline for English fans of Liverpool was Die Tageszeitung's 'Dortmund's going home' - in reference to the English song 'Three Lions', which was also popular in Germany after they won Euro 96.
Milner: Watershed moment
Liverpool vice-captain James Milner believes their dramatic victory over Borussia Dortmund could prove to be a watershed moment in the reign of Jurgen Klopp.
The Reds twice came back from two goals down against the Europa League favourites to win 4-3 on the night, 5-4 on aggregate, with Dejan Lovren's added-time goal putting them into the semi-finals.
The most significant change Klopp has made to the squad he inherited from Brendan Rodgers in mid-October - having eschewed the chance to strengthen in the January transfer window - is the belief he has instilled.
That got them over the line against his former club on a famous night at Anfield and Milner thinks overcoming that considerable hurdle and being just three matches away from winning a trophy, having lost February's Capital One Cup final to his previous side Manchester City on penalties, is significant.
"It will do a lot. I have said at times this year that I don't think there is that belief there that the boys believe how good they are," he said.
"It is a young team and sometimes we struggle for consistency but to beat a team like Dortmund and to come back the way we did and going this far in a major European competition is obviously massive.
"We got to the League Cup final and while we didn't win we put ourselves in position again.
"Hopefully we can get belief from this. if we can beat them we can beat anyone and hopefully we can now go on to win some silverware.
"It was the same when I was at City and we managed to win that first piece of silverware."
Klopp has a reputation for being a master motivator and he was at his best during the half-time interval.
Trailing 2-0 and with a mountain to climb the German evoked memories of Liverpool's past by recalling the 2005 Champions League final when they overturned a 3-0 half-time deficit against AC Milan to win a fifth European Cup on penalties.
Milner said: "The manager was brilliant. He was calm. He said, 'We are not playing too badly. It is a long way back, we have lost the first half but you have nothing to lose, go out and do it'.
"It would have been easy for him to come in effing and blinding but he didn't.
"He reminded us of a situation where the club has come through a similar situation before.
"He obviously mentioned a certain night in Istanbul and said there have been other great nights in this club's history from a similar position so go out and see what happens.
"I think it was the perfect atmosphere created at half-time to be honest."
When the players emerged early for the second half they were greeted with a chorus of You'll Never Walk Alone from the Kop, and as the tide finally began to turn their way in the closing 25 minutes the ground almost shook to the crowd's roar.
"The way the fans were when we were driving into the game they deserve that victory," Milner added.
"The atmosphere especially in the second half when we got the second goal and drove forward means it is difficult for any team to come here.
"When the crowd are like that there are not too many better places in the world to be playing and to be part of a night like that is fantastic."
With a Champions League place on offer for the winners there is the temptation to put all their focus onto Europe - Liverpool are currently eighth, nine points behind fourth-placed City with a match in hand - but Milner dismissed that.
"We will try to win every game. It is important to try to finish strongly in the league," he said ahead of Sunday's trip to Bournemouth.
"The performance was good at the weekend against Stoke (a 4-1 win) and I think that contributed massively to the Dortmund result and gave us the momentum to keep winning games."
Liverpool's greatest comebacks
Liverpool's remarkable 4-3 comeback win at Anfield on Thursday night to sink Borussia Dortmund 5-4 on aggregate and reach the Europa League semi-finals was just the latest in a string of improbable turnaround triumphs.
Here, we examine five classic comeback victories for the Anfield club.
Liverpool 3 AC Milan 3 (Liverpool won 3-2 on penalties, Champions League final, Istanbul, May 2005)
Liverpool beat Milan in a penalty shoot-out to win the Champions League after sensationally coming from three goals down at half-time in a match later dubbed The Miracle of Istanbul. Paolo Maldini gave Milan a first-minute lead, and two goals from Hernan Crespo put them in a seemingly unassailable position at the interval. Reds captain Steven Gerrard gave Liverpool hope, and Vladimir Smicer and Xabi Alonso levelled in a seven-minute spell. Jerzy Dudek then saved from Andrea Pirlo and Andriy Shevchenko in the shoot-out to clinch a stunning victory.
Liverpool 3 West Ham United 3 (Liverpool won 3-1 on penalties, FA Cup final, Cardiff, May 2006)
Steven Gerrard's added-time screamer dragged this Millennium Stadium final into extra time, just when West Ham thought they had the match done and dusted. The Reds captain's second goal salvaged a 3-3 draw at the last, after West Ham had thrown away a 2-0 first-half lead. Jamie Carragher's own goal and Dean Ashton's finish had the Hammers in control, before Djibril Cisse cut the deficit before the break. Gerrard levelled the tie at 2-2 before Paul Konchesky struck to edge the Londoners into that 3-2 lead that the Liverpool skipper cruelly snatched away at the death. Liverpool then prevailed 3-1 on penalties, only Teddy Sheringham finding the net from West Ham's four efforts, with John Arne Riise firing the decisive spot-kick.
Liverpool 3 Olympiacos 1 (UEFA Champions League Group Stage, Anfield, December 2004)
Liverpool had to win by two goals to advance to the knockout stages, so Rivaldo's 27th minute goal left the hosts with an uphill struggle. Florent Sinama Pongolle put the Reds back on terms after the break, before Neil Mellor edged Liverpool into the 2-1 lead with nine minutes to play. And then up popped Steven Gerrard, firing home from 20 yards to secure that two-goal victory margin, with just four minutes of normal time remaining.
Liverpool 3 St Etienne 1 (Liverpool won 3-2 on aggregate, European Cup third round second leg, Anfield, March 1997)
Liverpool were written off in advance of this second-leg European Cup clash at Anfield, coming into the tie trailing 1-0 on aggregate to the French champions. Kevin Keegan handed the Anfield men hope with a second-minute goal, only for Dominique Bathenay to draw the visitors level with the precious away goal. Liverpool had to score twice more without reply to reach the semi-finals. Ray Kennedy struck just before the hour to hand the home faithful hope, before David Fairclough fired the winner with just six minutes to play.
Liverpool 4 Newcastle 3 (Premier League, Anfield, April 1996)
Branded the Premier League's greatest ever game by many, and considered the defeat that ultimately came to define Newcastle's title-race implosion. Robbie Fowler struck for Liverpool after just two minutes, before Les Ferdinand and David Ginola had Newcastle leading 2-1 inside the quarter-hour. Fowler equalised after the break, only for Faustino Asprilla to put Newcastle 3-2 ahead before the hour-mark. Collymore grabbed his second goal with little more than 20 minutes to play to tie the game at 3-3. And just when Newcastle thought they could escape Anfield with a point the former Nottingham Forest striker slotted home Liverpool's winner. Footage of Newcastle boss Kevin Keegan slumped over in the dugout still encapsulate a breathless night.
No more pressure than normal, says Jurgen Klopp
Liverpool manager Jurgen Klopp insists his side are under no greater pressure than normal ahead of their Europa League quarter-final second leg at home to Borussia Dortmund.
The Reds hold a slender advantage in that they have an away goal from the 1-1 draw a week ago and will have the Anfield crowd behind them.
Klopp believes his side are in the best position they have been since he took over in October.
"I don't think we are under particular pressure," he said.
"What we are presented with is a great chance to get to the semi-final and it is rare to have a chance to win a trophy.
"It is not a question of pressure. The last few weeks has given us confidence.
"When you think about only the second half against Southampton (where they conceded three goals to lose 3-2) was a step in the wrong direction.
"We are better prepared than a few months ago when I started here because now we are together for six months and that helps a lot.
"We are growing as a group, believing more in things and there is no doubt about the things we do.
"That is what has given us confidence. It is not important what I say here, it will have no impact on the game tomorrow.
"It is a good sign for all of us that we trust them (the players) and they trust themselves."
Liverpool edged the tie in Germany and could have come away with more than one away goal but Klopp expects his former club to put in an improved display.
But he expects his players to raise their game also.
"I don't think we went to the limit of our performance last week and I don't think Dortmund did either but they are having a great season," he said.
"Dortmund can play better but so can we. We have to do better.
"Against Dortmund you can't just defend, there is a balance between attack and defence.
"Forget about last week's game, we have to go into tomorrow's game with a different attitude and we certainly won't be flying a white flag."
Klopp called on his players to approach the tie with no fear.
"It is always about being brave, especially against a high-quality team," he added.
"With each offensive action they (the opponent) have they grow in confidence and you become smaller and smaller so it is really important because everything can have an influence: on the positive side, negative side.
"Being brave is one of the most important things in football."
We look at some of the issues surrounding the game.
AN AWAY GOAL HELPS, RIGHT?
It does if Liverpool can keep a clean sheet - something they have not managed in the last five matches. Even if they managed to keep Dortmund's primary threats Pierre-Emerick Aubameyang, Henrikh Mkhitaryan and Marco Reus quiet in Germany, fallibility at set-pieces cost them and it is difficult to believe a side which has scored 119 goals this season and has failed to score just once - against Bayern Munich - in the last 13 matches will not manage one goal at Anfield.
WHAT'S THE GAME PLAN?
Very similar to the one at Signal Iduna Park: press Dortmund hard, disrupt their midfield and throw everything in the way when it comes to defending. Liverpool must also take their chances when they come.
They dominated the first half in Germany and should have had returned with more than one away goal.
HOW BIG IS THE TASK AHEAD OF LIVERPOOL?
Despite holding an away goal it will not count for much until the latter stages providing the game is still goalless.
Dortmund are arguably stronger than the first leg as midfielder Ilkay Gundogan is fit while Mkhitaryan played just 45 minutes at the weekend, Aubameyang 17 and Reus was an unused substitute.
Liverpool, arguably, are weaker with a knee injury sustained by Jordan Henderson in Germany ruling him out for the rest of the season.
DIVOCK ORIGI, DANIEL STURRIDGE, OR BOTH?
Origi justified Jurgen Klopp's faith in preferring him in Dortmund with a goal but his movement and persistent running to trouble the back four deserved just as much credit.
Origi came off the bench to score twice against Stoke at the weekend, overshadowing Sturridge who scored his third in five starts. If chance conversion is the priority then Sturridge fares better in that respect. It would be a bold move by Klopp to field both strikers from the off.
HOW MUCH WILL HOME ADVANTAGE MEAN?
Anfield is preparing for another famous European night with fans armed with flags - and probably flares and other pyrotechnics - set to line the street for the team coach's journey to the stadium.
Inside the Kop will be festooned by a myriad of flags but atmosphere will be briefly tempered somewhat by a minute's silence for the 27th anniversary of the Hillsborough disaster - complete with mosaics by both home and away fans. After that all bets are off.
COMMENT RULES: Comments that are judged to be defamatory, abusive or in bad taste are not acceptable and contributors who consistently fall below certain criteria will be permanently blacklisted. The moderator will not enter into debate with individual contributors and the moderator’s decision is final. It is Belfast Telegraph policy to close comments on court cases, tribunals and active legal investigations. We may also close comments on articles which are being targeted for abuse. Problems with commenting? firstname.lastname@example.org