MADRID: Barcelona coac Xavi Hernandez said he had decided to step down at the end of the season after a 5-3 home defeat by Villarreal in LaLiga, their third defeat in their last five games in all competitions.

Barcelona are third in the table on 44 points, 10 behind leaders Real Madrid and eight adrift of second-placed Girona.

Xavi, after a meeting with president Joan Laporta, told a press conference: “I’d like to announce that as of June 30 I will not continue as Barca coach. It is a situation of common sense and I have decided that on June 30th I will not continue as Barca coach.

“I think the club needs a change of dynamic and I told the president Joan Laporta. As a fan, thinking about the club and the players, I think they will be freed up and will be calmer.

“I think the best thing to do is to leave on June 30th. Having said that, I will give my all for the four months that are left, I think we can have a good season and I hope that the dynamic will change. I believe I am doing the right thing.”

Xavi played for Barcelona for 17 years, making 767 appearances and winning 25 trophies, including four Champions League titles and eight LaLiga crowns. But despite being a club great and winning LaLiga last term, Barca’s stuttering campaign has put Xavi under pressure.

They were thrashed by Real in the Spanish Super Cup final earlier in January and knocked out in the Copa del Rey quarter-finals by Athletic Bilbao on Wednesday. Barca face last season’s Italian champions Napoli in a Champions League last-16 tie.

“I had a very human conversation with the president (Laporta), with a lot of common sense. The trust is absolute, he even got a little emotional,” 44-year-old Xavi added.

“But I think it is time. I’m not driven by financial matters, but by my heart. I think it’s the best thing for the club. I don’t want to be a problem for the club in my heart.

“This game today is an example that we need a change of direction because it has been unfortunate and it is a time to change this dynamic. I can’t remember a game as cruel as today.

“I insist. I don’t want to be a problem but a solution and I believe that between now and June I can still be a solution.”

Barca concede twice in added time to Alexander Sorloth and Jose Luis Morales as Villarreal turned the match on its head.

Barca remain in third place on 44 points, 10 behind leaders Real Madrid for whom Aurelien Tchouameni came off the bench and scored with a late header to snatch a 2-1 come from behind win at Las Palmas.