Alonso, 32, joined Barca on an initial one-year deal as a free agent from Chelsea last summer after his contract with the Premier League side was terminated.
The Spain international is now committed to Barca until 2024, with the potential to stay until 2025 contingent on if he plays a certain number of games during the 2023-24 season. His release clause remains fixed at €50 million.
Alonso, whose father also played for Barca, has featured regularly at centre-back and left-back this season under Xavi Hernandez. He has made 19 appearances across all competitions, scoring twice.
"I am really happy with Marcos," Xavi said in a news conference on Friday. "Firstly, as a person and as a professional inside the dressing room, where he has adapted really well.
"But also as a player. He is solid, mature and experienced. He has been a top-level signing and will be really important for us moving forward."
More Marcos! 💙❤️ pic.twitter.com/0lI3Ndmp4j— FC Barcelona (@FCBarcelona) January 27, 2023
He made over 200 appearances for the London club, winning a Champions League and a Premier League title during his six-year stay.
Meanwhile, Barca have also confirmed that talented teenager Angel Alarcon has penned a new deal until 2025. His release clause has been fixed at €400m.
Alarcon, 18, made his first-team debut in the 5-0 Copa del Rey win at AD Ceuta this month and the forward will form part of the squad for the LaLiga game at Girona on Saturday. Robert Lewandowski and Ferran Torres will both miss the match through suspension.