Elon Musk’s social media platform, X, informed the Brazilian Supreme Court that it has complied with orders aimed at curbing the spread of misinformation.

According to a document obtained by Reuters, X has requested the court to revoke the ban it imposed on the social media platform in August which shut Brazilians’ access to the platform.

The 53-year-old tech billionaire had opposed the measures for over five months, labelling them as “censorship” during a feud with a judge in Brazil — one of X’s largest and most coveted markets.

Although a decision on X’s return is still pending, sources close to the Tesla CEO in Brazil are optimistic that the service could be reinstated within days.

Late on Thursday, X said access to the site in Brazil “is essential for a thriving democracy” and that it respects the sovereignty of the countries in which it operates, Reuters reported.

“We will continue to defend freedom of expression and due process of law through legal processes,” the company’s global affairs team added in a post on the platform.

Justice Alexandre de Moraes, who has spearheaded a local crusade against perceived attacks on democracy and the political use of disinformation, banned the platform formerly called Twitter after Musk shuttered X’s offices in Brazil.

The judicial battle eventually affected another prominent business controlled by Musk, satellite internet provider Starlink, whose accounts de Moraes froze in a move leading Musk to brand him a “dictator.”

The Brazil spat was one of a series of recent face-offs between Musk, who views himself as a champion of free speech, and governments including Australia and the United Kingdom seeking to prevent the spread of online misinformation.

Brazil was X’s sixth-biggest market globally, with about 21.5 million users.

“Musk was afraid to lose market share, he also realized that this was a nonsense battle and that Brazilians were not turning their backs on Justice Alexandre de Moraes as he had expected,” said Thiago de Aragao, a senior researcher at the Center for Strategic and International Studies in Washington.

In a final attempt at circumventing Moraes’ ban, X used cloud services offered by third parties, allowing Brazilians to access its platform in spite of the prohibition, but the attempt was short-lived, especially after Moraes threatened to impose heavy fines on the company.

Late last week, X moved in a more conciliatory direction, appointing a local legal representative as Moraes had demanded.

In the document sent to the Brazilian Supreme Court, X said it had blocked nine accounts under investigation in a hate speech and misinformation probe.

“His backtracking is very positive. Whether one agrees with it or not, the law is to be respected not defied,” Rubens Barbosa, a former Brazilian ambassador to the United States, told Reuters.

According to two people familiar with Musk’s thinking, the billionaire will take a very different approach once X comes back to Brazil, adding he may still be combative but will likely try to respect the law. “From now on, he will fight in the courts,” one of the people said.