Salah, 33, joined Liverpool in 2017 and established himself as a Reds icon by becoming the club's third-highest scorer in history.
The Egyptian will leave Anfield having won a haul of trophies, including two Premier League titles, the Champions League, the FA Cup, the EFL Cup and the Club World Cup.
"Unfortunately, the day has come," Salah began with a statement on social media.
"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 and the people would become part of my life. Liverpool is not just a football club. It is a passion, a history, a spirit. I can't explain in words.
"We won the most important trophies and we fought together through the hardest time in my life. I want to thank everyone who has been part of this club throughout my time here."
'I will never walk alone'
Joining Liverpool from Roma, Salah scored 255 goals in 453 appearances in a highly successful nine-year spell, which placed the club among the best in Europe.
He signed a new contract until 2027 in April last year, but circumstances have been more challenging this season.
Salah has been in mixed form under Arne Slot, scoring five goals and assisting six in 22 Premier League games as Liverpool fight to qualify for next season's Champions League.
He added: "I don't have enough words. The support you showed me through the best times of my career, and you stood by me in my toughest times. It is something I will never forget.
"Leaving is never easy. I will always be one of you and this club will always be home to me and to my family. Thank you for everything. Because of all of you, I will never walk alone."
Liverpool hailed Salah's illustrious tenure as "remarkable", while adding the announcement was made to clarify his future to the club's supporters.
The club said: "Salah expressed his wish to make this announcement to the supporters at the earliest possible opportunity to provide transparency about his future due to his respect and gratitude for them."
