The billionaire's company claims Moraes secretly threatened one of its legal reps with arrest if they didn't comply with orders to remove specific content.
X, never one to shy away from drama, shared pictures of a document allegedly signed by Moraes. The document threatened a daily fine of 20,000 reais (£2,900) and an arrest decree against X representative Rachel Nova Conceicao if the platform didn't toe the line.
"To protect the safety of our staff, we have decided to close our operation in Brazil, effective immediately," X announced, playing the victim card.
Brazil's Supreme Court, where Moraes sits, refused to comment on the matter or confirm the document's authenticity. Meanwhile, X assured that its service would still be available to Brazilians.
Earlier this year, Moraes ordered X to block certain accounts as part of his investigation into "digital militias" accused of spreading fake news and hate messages during the reign of far-right former President Jair Bolsonaro.
Musk called Moraes' decisions "unconstitutional" and vowed to reactivate the blocked accounts.
After some back-and-forth, X's representatives eventually caved and told Brazil's Supreme Court they would comply with the legal rulings. They blamed "operational faults" for allowing users who were supposed to be blocked to stay active.
In a series of posts on X, Musk lashed out at Moraes, calling him an "utter disgrace to justice" and decrying the judge's "secret censorship and private information handover demands."