SAO PAULO — Ronaldinho's stint with Brazil's most popular club is over after the player decided to sue Flamengo for reportedly $20 million for unpaid salaries and delayed payments.

Ronaldinho's lawyer Gislaine Nunes said on Thursday a judge ruled in favor of the player's request to have his contract terminated. They want the club to pay everything they claim it owes to the two-time world player of the year in wages and other rights.

"His contract has been terminated," Nunes said. "Flamengo has already been notified. Now we are demanding a very high amount in compensation, of course, which he has the right to receive by contract."

Ronaldinho said suing Flamengo was the last thing he wanted to do but had no other option.

"I waited as long as I could, but it got to a point that it was enough," he told Brazil's UOL website. "I decided to contact my lawyers and end this cycle. I'm sad for the friends that I left there, for the fans who supported me."

Flamengo said it was surprised with Ronaldinho's decision.

"We didn't expect an attitude like this," club president Patricia Amorim said. "Now the case is in the hands of our legal department, which will take the necessary legal measures to defend the interests of Flamengo. The club is greater than any person and it's going to be like this forever."

The club said in a statement that the player made the decision to leave after "missing practice for four days." It said Ronaldinho was suing for an "alleged debt."

Local media reported Ronaldinho was asking for a total of nearly $20 million from Flamengo, which says it doesn't owe the player that much.

"That amount is absurd," said Rafael De Piro of the club's legal department. "We will take a close look at the lawsuit before making a decision. We've forgiven Ronaldinho's acts of indiscipline during all this time."

Last month, Flamengo's biggest fan group published a letter on its website criticizing Ronaldinho and accusing him of being unprofessional for his alleged appearances at parties and nightclubs.

Ronaldinho was under heavy pressure because of his poor performances and the team's disappointing results this year. Fans and even team coach Joel Santana had been castigating him, and there had been talks about the player possibly leaving the club for some time.

The spat with Flamengo escalated on Wednesday, when the club's vice president of football, Paulo Cesar Coutinho, was caught on camera telling fans that Ronaldinho wasn't playing well and that president Amorim was going to suspend the player, apparently for not giving an explanation for why he decided not to play in a friendly organized to bring in funds that would help pay for part of his salaries.

The 32-year-old Ronaldinho said he wasn't going to play because his mother was sick and recently underwent surgery to remove a tumor in the southern city of Porto Alegre.

"My mind was in Porto Alegre, there was nothing I could do," he said. "Now I will take some time off to take care of my mum. That's the most important thing right now."

Ronaldinho's agent and brother, Roberto de Assis, had been complaining recently that the club wasn't paying Ronaldinho everything that he was owed contractually.

Flamengo has admitted having difficulties paying for Ronaldinho's salary since ending its partnership with sports marketing group Traffic, which had been in charge of the majority of the nearly $700,000 that the player reportedly received monthly.

Ronaldinho became one of the most high-profile acquisitions by a Brazilian club when he joined Flamengo at the beginning of last year after a decade playing in European football, where he thrived with Barcelona and AC Milan.

He struggled in his first few months with Flamengo and was jeered by fans, but bounced back and was instrumental in Flamengo's title in the Rio de Janeiro state championship in 2011. He then helped Flamengo earn a spot in this year's Copa Libertadores and regained a spot in the national team, but began poorly again throughout this year.

Ronaldinho's lackluster performances may have already cost him a chance to play in the Olympics again. Coach Mano Menezes left him out of the team playing friendlies in preparation for the tournament in London and hinted he will not include the player in the final Olympic squad.

Ronaldinho helped Brazil win the 2002 World Cup in South Korea and Japan, but was in the team that was eliminated by France in the 2006 quarterfinals in Germany. He was not picked for the 2010 World Cup in South Africa.

Follow Tales Azzoni at