CNN  — 

Barcelona has announced the appointment of club legend Xavi Hernández as the club’s new coach on a deal that includes the remainder of the current season plus two additional seasons.

He replaces Ronald Koeman, who was sacked last month following a dismal start to the season.

The club says the 41-year-old Xavi is expected to travel to Barcelona over the weekend ahead of a formal presentation as the new head coach at the Camp Nou on Monday.

Xavi made a record 767 appearances for Barcelona, winning eight La Liga titles and four Champions Leagues during his time at the Catalan club.

Visit CNN.com/sport for more news, videos and features

Xavi celebrates winning the Champions League with Barcelona in 2015.

He also played a key role during Spain’s dominant run from 2008 to 2012 when the country won the World Cup and two European Championships.

The former midfielder, widely considered one of the greatest of his generation, called time on his Barcelona career in 2015 to begin a new chapter with Qatari side Al-Sadd SC.

He officially hung up his boots in 2019 before being appointed Al-Sadd’s manager, and since his appointment, he has led the club to seven trophies, including one league title.

READ: Tottenham Hotspur wins first match under Conte

Xavi signed a new deal with the club in May to extend his contract to 2023.

The midfield maestro has never hidden his desire to one day return to Barcelona

In an interview with CNN’s Becky Anderson in 2017, Xavi said: “It’s an objective to help them [Qatar] have a good World Cup in 2022, and then in my mind I have it to come back to Barcelona. One of my dreams in the future is to coach FC Barcelona.”

Xavi managed Al-Sadd for two years.

Xavi’s appointment comes with Barcelona currently ninth in La Liga with 16 points from 11 games, nine points behind current leader Real Sociedad.

The club is second in its UEFA Champions League group with six points from four matches after suffering 3-0 defeats in its opening two games against Bayern Munich and Benfica.