What just happened? X has ended its operations in Brazil amid a censorship row with one of the country's top judges. The former Twitter platform said that the move was made to protect staff in Brazil after Alexandre de Moraes threatened one of its legal representatives with arrest if the company did not remove certain content from the site.

According to X, de Moraes, the president of the Superior Electoral Court and a justice of the Supreme Federal Court, made the threat in a "secret order."

X published photos of a document allegedly signed by de Moraes that says a daily fine of 20,000 reais ($3,653) and an arrest decree would be imposed against X representative Rachel Nova Conceicao if the platform did not fully comply with de Moraes' orders to remove specific content.

Rather than comply with the order, X has instead opted to shutter its operations in Brazil "to protect the safety of our staff." X said it was "deeply saddened" that it had to make the decision, and that the blame "lies solely" with de Moraes. The company added that Brazilian staff had no responsibility or control over whether content is blocked

Owner Elon Musk assured people in Brazil that they are still able to use X. He added that the demand "would require us to break (in secret) Brazilian, Argentinian, American and international law."

"The decision to close the X office in Brazil was difficult, but, if we had agreed to @alexandre's (illegal) secret censorship and private information handover demands, there was no way we could explain our actions without being ashamed," Musk wrote in an X post.

Earlier this year, de Moraes ordered X to block accounts – many of them belonging to supporters of former president Jair Bolsonaro – accused of spreading disinformation while they were under investigation.

Musk refused to implement the bans, claimed the orders were unconstitutional, and called for de Moraes to resign. It led to the judge opening an obstruction of justice inquiry against the billionaire. X then reversed course, stating in April that it would comply with every ruling issued by either the court or Brazil's top electoral court.

After de Moraes asked X in April why it had not fully complied with his decision, lawyers representing the firm in Brazil told the Supreme Court that "operational faults" had allowed users who were ordered to be blocked to stay on the platform.

Musk recently compared de Moraes to Harry Potter's nemesis Lord Voldemort.