Salah's previous contract would have expired next summer.
Salah joined Liverpool from AS Roma in the summer of 2017 and has since taken his game to a whole new level.
The former FC Basel and Chelsea forward has won the Premier League, UEFA Champions League, UEFA Super Cup, FIFA Club World Cup, Carabao Cup and FA Cup with Liverpool.
A record of 156 goals in 254 appearances across all competitions ranks Salah ninth on Liverpool's all-time top scorer's list.
The Egypt international has won the Premier League golden boot three times and has been crowned Professional Footballers' Association (PFA) player of the year on two occasions.
“I feel great and [I am] excited to win trophies with the club," Salah told liverpoolfc.com.
"It’s a happy day for everyone.
“It takes a little bit of time, I think, to renew, but now everything is done so we just need to focus on what’s next. I think you can see in the last five or six years the team was always going [upwards].
"Last season we were close to winning four, but unfortunately in the last week of the season we lost two trophies. I think we are in a good position to fight for everything. We have new signings as well. We just need to keep working hard, have a good vision, be positive and go for everything again.”
"My message [to the fans] is the players in the team want to give our best next season to try to win all the trophies," Salah continued.
“As usual, you stay behind us and give us a big push and I am sure we are going to win trophies again [together].”