The 33-year-old arrived at Anfield from Roma in 2017 and has made 435 appearances for Liverpool, scoring 255 goals and winning two Premier League titles, four top goalscorer's Golden Boots, as well as the Champions League.
He established himself as one of Liverpool's greatest players and also had a social impact, being credited with helping to integrate the city's Muslim community, aiding acceptance of Islam on Merseyside and a reduction in hate crime.
However, his influence on the pitch has waned in the past season and he has at times been at odds with the club and manager Arne Slot.
In a video posted on X featuring highlights of his time with Liverpool, Salah said: "Hello everyone. Unfortunately, the day has come.
"This is the first part of my farewell. I will be leaving Liverpool at the end of the season.
"I never imagined how deeply this club, this city, these people would become part of my life.
"We celebrated victory, we won the most important trophies and we fought together through the hardest time in our life.
"And to the fans, I don't have enough words.
"Leaving is never easy. You gave me the best time of my life. I will be always one of you. This club will always be my home, to me and to my family."
In a statement on Liverpool's website, the club described Salah as one of their greatest players.
"Mohamed Salah is to bring the curtain down on his illustrious career with Liverpool at the end of the 2025-26 season,'' the statement said.
"The forward has reached an agreement with the Reds that will see him close a remarkable nine-year chapter at Anfield.
"Salah expressed his wish to make this announcement to the supporters at the earliest possible opportunity to provide transparency about his future."
In December, Salah's future at Liverpool was cast into doubt following comments made after a draw against Leeds, where he suggested he had no relationship with Slot and said he had been "thrown under the bus".
He was left out of the starting XI for the next two matches, before departing to represent Egypt in the Africa Cup of Nations.
Salah returned to the fold for a Champions League victory against Marseille in January and has since been a regular starter.
This season he has made 34 appearances for the Reds, scoring 10 goals.
Salah helped lead Liverpool to Premier League titles in 2019-20 and 2024-25, as well as the FA Cup (2022), League Cup (2022-24) and UEFA Champions League trophy (2019).
- with Reuters