MADRID — Javier Mascherano bid farewell to Barcelona on Wednesday, saying he has lost the will to keep fighting to be a starter and needed a fresh start somewhere else.

The 33-year-old Argentine defender, who is joining Hebei China Fortune, said he felt he wouldn’t be able to remain significant for Barcelona and it was best to leave on good terms.

“I had been thinking about this for some time,” said Mascherano, who at times struggled to hold back tears. “I’ve always said that the hardest part about playing for Barca was that one day I would have to leave the club. But you have to make decisions. As time passed, it was becoming clear that I was losing space as a protagonist and everything was becoming harder for me.

“Before putting the club in a position to make a decision and risk ending things in a bad way, I decided to reach a solution that was satisfactory for both parts.”

Mascherano made his comments in a farewell ceremony organized by the club with the presence of president Josep Bartomeu and the rest of the squad. Former players such as defender Carles Puyol also attended.

“It takes a toll to be in a place for so long,” said Mascherano, who stayed almost eight seasons with the Spanish club. “I didn’t have the same strength that I had before to keep fighting for a place in the starting lineup. Sometimes you need to reset and to start over and seek new challenges in different places.”

His teammates recorded video messages that were shown during the ceremony at Camp Nou. He is expected to say goodbye to the fans before Thursday’s home game against Espanyol in the quarterfinals of the Copa del Rey.

Barcelona did not release financial details of Mascherano’s transfer to China.

Mascherano arrived in Barcelona in 2010 from Liverpool and helped the Catalan club win 18 titles. He made 334 appearances with Barcelona, but recently hadn’t been playing much as coach Ernesto Valverde preferred to use Gerard Pique and Samuel Umtiti as the regular starters in the middle of the defence.

The club earlier this month signed Colombia international Yerry Mina to boost the defence. Thomas Vermaelen, who is injured, is the other central defender.

Mascherano, who was Barcelona’s fourth captain and also played as a defensive midfielder, previously played for River Plate in Argentina, Corinthians in Brazil and West Ham in England.

“It was a dream to come play for Barcelona,” Mascherano said. “Now I’m waking up and the dream is coming to an end.”