Roma must now match the exploits of their remarkable quarter-final comeback against Barcelona if they are to win the tie.
Liverpool were arguably second best in the opening half-hour but a blistering strike from Salah against his old club set Jurgen Klopp's side on their way.
Salah added a second just before the break, becoming the first Liverpool player to hit 10 in a single European campaign, before turning provider for Salah and Firmino as Roma failed miserably to deal with the hosts' attack.
Firmino nodded in the fifth from a routine set-piece but Eusebio Di Francesco's men snatched two away goals in the dying minutes to offer some hope of salvation.
What. A. Game!
Salah (2), Mané & Firmino (2) all net for Liverpool again but Roma grab late away goals in an epic semi-final tie Anfield.
Best game this season? #UCL pic.twitter.com/9l3pJWn0pQ — UEFA Champions League (@ChampionsLeague) April 24, 2018
The home side lost Alex Oxlade-Chamberlain 17 minutes in after he hurt himself challenging Aleksandar Kolarov, who nearly snatched the lead soon afterwards, with Loris Karius fumbling his fierce strike onto the crossbar.
Mane wasted a great chance one-on-one with Alisson, firing over the bar from 12 yards, but the miss seemed to galvanise Liverpool. Salah saw a shot beaten away by the Roma keeper and Mane turned in an Andrew Robertson cross only to be denied by the offside flag.
There was no such problem for Salah 10 minutes before the break, though. Firmino fed him just inside the area to the right, Roma's defence stood off, and he curled a stunning strike into the far top corner.
Roma suddenly looked vulnerable at every Liverpool attack and Dejan Lovren should have made it 2-0 as he headed off the crossbar when unmarked six yards from goal.
But Salah made no mistake with a sumptuous second in the 45th minute, racing through onto Firmino's pass before clipping a clever finish over Alisson.
10 - Mohamed Salah has scored 10 goals in the Champions League this season, the most by a Liverpool player in a single season in European competition. King. pic.twitter.com/aJJkiIxis6 — OptaJoe (@OptaJoe) April 24, 2018
Roma's high defensive line was being brutally exposed but they seemed not to learn their lesson 11 minutes after the break. Salah escaped a close offside call to race into the area and squared the ball for Mane, who this time showed composure to side-foot into the bottom corner.
Five minutes later, Liverpool had their fourth. Salah again raced onto a simple ball down the right, skipped beyond Juan Jesus and scuffed a cross to the far post, where Firmino tapped in.
The Brazilian then rose unmarked to head his second and Liverpool's fifth in the bottom corner of the net from Milner's cross in the 78th minute.
What looked to be a memorable win was tarnished nine minutes before the end, though, as Dzeko pulled down Radja Nainggolan's fine pass before burying a finish beyond Karius.
Perotti then fired a penalty high into the net after James Milner blocked Nainggolan's shot with his arm, giving Roma hope of a second-leg turnaround that had looked practically impossible with 80 minutes played.
Key Opta stats:
- Liverpool are only the second side in Champions League history to score five goals in a semi-final game (also Ajax in 1995, 5-2 v Bayern Munich).
- This game produced the joint-most goals of any Champions League semi-final game ever (also seven when Ajax beat Bayern Munich 5-2 in 1995).
- Liverpool are the first side in Champions League history to see three players score eight or more goals in a single season in the competition (Salah 10, Firmino 10, Mane 8).
- Mohamed Salah has netted 10 goals in the Champions League this season, the most by a Liverpool player in a single season in European competition ever.
- Salah has netted 43 goals in all competitions this season; only Ian Rush in 83/84 (47) has scored more in a single campaign for Liverpool.
- Salah's haul of 43 goals in the most by any player in all competitions in Europe’s top five leagues this season.
- Salah has scored in each of his last five Champions League starts for Liverpool, something only Steven Gerrard had previously done (Steven Gerrard between October 2007 and February 2008).
- Only Cristiano Ronaldo (18) has been directly involved in more Champions League goals this season than Firmino (16, 10 goals, 6 assists).
- James Milner has provided eight assists in the Champions League this season, the joint-most ever in a single campaign in the competition since Opta started recorded this data (03/04), level with Neymar in 16/17.