Social media giant X is closing its offices in Brazil due to legal threats from Brazilian judge Alexandre de Moraes.

The company claimed Saturday that executives were "forced to make this decision" after de Moraes threatened arrests if the platform did not take down content deemed problematic by the Brazilian government.

"Last night, Alexandre de Moraes threatened our legal representative in Brazil with arrest if we do not comply with his censorship orders," the X Global Government Affairs office announced via the platform. "He did so in a secret order, which we share here to expose his actions."

Tesla CEO Elon Musk

Chief Executive Officer of SpaceX and Tesla and owner of Twitter, Elon Musk attends the Viva Technology conference in Paris, France.  (Photo by Chesnot/Getty Images / Getty Images)

"Despite our numerous appeals to the Supreme Court not being heard, the Brazilian public not being informed about these orders and our Brazilian staff having no responsibility or control over whether content is blocked on our platform, Moraes has chosen to threaten our staff in Brazil rather than respect the law or due process. As a result, to protect the safety of our staff, we have made the decision to close our operation in Brazil, effective immediately."

De Moraes ordered X to take down specific accounts earlier this year, accusing the platform of harboring "digital militias" he claims were spreading misinformation and hateful material regarding former President Jair Bolsonaro.

"Due to demands by "Justice" [de Moraes] in Brazil that would require us to break (in secret) Brazilian, Argentinian, American and international law,