Lovren rose at the far post to rifle home his header in the first minute of added time, recalling memories of Liverpool’s 2005 Champions League final comeback against AC Milan and propelling them into the last four with a 5-4 aggregate victory.
Liverpool, 2-0 down after nine minutes, will be joined in Friday’s draw by holders Sevilla, who needed a penalty shootout to edge past Spanish rivals Athletic Bilbao.
Spain will have two sides in the last four after Villarreal beat Sparta Prague 4-2 and 6-3 over the two legs, while Shakhtar Donetsk defeated Braga 4-0 at home to complete a 6-1 aggregate triumph.
Liverpool’s victory at Anfield was greeted by typically exuberant celebrations from manager Juergen Klopp, who spent seven years at Dortmund and would have been no stranger to the quick-fire counter attacks that earned the visitors a 2-0 lead.
Liverpool might have felt they had a slight advantage over Dortmund having snatched an away goal in a 1-1 first-leg draw, but the tables were turned in the blink of an eye after a whirlwind start by the Germans.
Liverpool were slapdash in possession, Dortmund ruthless on the counter as they brutally punishing Liverpool’s errors with both early goals starting from the hosts gifting them the ball.
Dortmund played with the same intensity they did when Klopp led them to two Bundesliga titles and a Champions League final, harrying Liverpool all over the pitch and winning back the ball in dangerous areas.
The first goal arrived after five minutes as a rapid break ended with Simon Mignolet saving brilliantly from Pierre-Emerick Aubameyang, only for Henrikh Mkhitaryan to sweep home the rebound.
It was soon 2-0 as Marco Reus powered through the Liverpool midfield and fed Aubameyang to rifle his finish into the roof of the net, beating Mignolet at his near post.
Having never lost at home to German opposition in 13 games, Liverpool were suddenly facing a mountainous climb back into the encounter, but they were given hope three minutes into the second half when Divock Origi raced through and poked his finish past Roman Weidenfeller.
Their spirits were swiftly dampened, however, when Reus made it 3-1 after 57 minutes, before being partially restored through Philippe Coutinho’s curling effort.
The Anfield roar went into overdrive when Mamadou Sakho levelled with a header from a corner with 12 minutes remaining and the final blow was delivered when Lovren rose to head home James Milner’s cross.
That sparked euphoric celebrations among the home support and left the visiting contingent holding their heads in disbelief.
“It is difficult to explain. A wonderful, wonderful night at Anfield and to be honest the game was strange,” an almost disbelieving Klopp said.
Liverpool are no strangers to titanic fightbacks with perhaps the greatest moment in their history coming when they came back from 3-0 down against Milan to win a fifth European title on penalties.
Just as on that night 11 years ago, their opponents were left wondering how they had lost control of the match.
“It was not logical. It was very emotional. At the end at 3-3 everyone here believed it was meant to be, it was destiny,” Dortmund coach Thomas Tuchel said.
“If you have such a strong belief then things can happen.”
Sevilla, who have made the competition their own in the last two years, lost 2-1 at home to Bilbao, but edged through on penalties.
They fell behind when Aritz Aduriz scored his 10th goal in this season’s competition and after equalising through Kevin Gameiro, were behind again when Raul Garcia found the net with a looping header 10 minutes from time.
That levelled the tie at 3-3 on aggregate and forced extra time. With the sides still level after 120 minutes, Sevilla sneaked through after Bilbao’s Benat Etxebarria missed their fourth spot-kick and Gameiro scored to secure a 5-4 shootout victory.
Shakhtar Donetsk cruised into only their second European semi-final with Darijo Srna opening the scoring from the penalty spot to mark his record-breaking 486th game for the club.
Two own goals from Braga centre back Ricardo Ferreira either side of a goal from Viktor Kovalenko rounded off the scoring.
Villarreal’s Cedric Bakambu struck twice to take his tally in the competition to nine goals as they reached the semi-finals for the third time with a 4-2 win at Sparta Prague.