SÃO PAULO — Brazil started blocking Elon Musk’s social media platform X early Saturday, making it largely inaccessible on the web and through its mobile app after the company refused to comply with a judge’s order.

X missed a deadline imposed by Supreme Court Justice Alexandre de Moraes to name a legal representative in Brazil, triggering the suspension. It marks an escalation in the months-long feud between Musk and De Moraes over free speech, far-right accounts and misinformation.

To block X, Brazil’s telecommunications regulator, Anatel, told internet service providers to suspend users’ access to the platform. As of Saturday, major operators had begun doing so.

De Moraes had warned Musk on Wednesday night that X could be blocked if he failed to comply with his order to name a representative, and established a 24-hour deadline. The company hasn’t had a representative in the country since last month.

“Elon Musk showed his total disrespect for Brazilian sovereignty and, in particular, for the judiciary, setting himself up as a true supranational entity and immune to the laws of each country,” De Moraes wrote in his decision Friday.

The justice said the platform will stay suspended until it complies with his orders, and he set a daily fine of $8,900 for people or companies using virtual private networks, or VPNs, to access it.

In a later ruling, he backtracked on his initial decision to establish a five-day deadline for internet service providers themselves — and not just the telecommunications regulator — to block access to X, as well as his directive for app stores to remove VPNs.

Brazil is one of the biggest markets for X, which has struggled with the loss of advertisers since Musk purchased Twitter in 2022 and rebranded it. Market research group Emarketer says some 40 million Brazilians, roughly one-fifth of the population, access X at least once per month.

“This is a sad day for X users around the world, especially those in Brazil, who are being denied access to our platform. I wish it did not have to come to this — it breaks my heart,” X’s Chief Executive Linda Yaccarino said Friday night, accusing Brazil of failing to uphold its constitution’s pledge to forbid censorship.

X posted on its official Global Government Affairs page late Thursday that it expected X to be shut down by De Moraes “simply because we would not comply with his illegal orders to censor his political opponents.”

“When we attempted to defend ourselves in court, Judge de Moraes threatened our Brazilian legal representative with imprisonment. Even after she resigned, he froze all of her bank accounts,” the company wrote.

X has clashed with De Moraes over its reluctance to comply with orders to block users.

Accounts that the platform previously has shut down on Brazilian orders include lawmakers affiliated with former President Jair Bolsonaro’s right-wing party and activists accused of undermining Brazilian democracy. X’s lawyers in April sent a document to the Supreme Court in April, saying that since 2019 it had suspended or blocked 226 users.

In his decision Friday, De Moraes’ cited Musk’s statements as evidence that X’s conduct “clearly intends to continue to encourage posts with extremism, hate speech and anti-democratic discourse, and to try to withdraw them from jurisdictional control.”

In April, De Moraes included Musk as a target in an investigation over the dissemination of fake news and opened a separate investigation into the executive for alleged obstruction.

Musk, a self-proclaimed “free speech absolutist,” has repeatedly claimed the justice’s actions amount to censorship, and his argument has been echoed by Brazil’s political right. He has often insulted De Moraes on his platform, characterizing him as a dictator and tyrant.

De Moraes’ defenders have said his actions aimed at X have been lawful, supported by most of the court’s full bench and have served to protect democracy at a time it is imperiled. He wrote Friday that his ruling is based on Brazilian law requiring internet services companies to have representation in the country so they can be notified when there are relevant court decisions and take requisite action — specifying the takedown of illicit content posted by users, and an anticipated churn of misinformation during October municipal elections.

The looming shutdown is not unprecedented in Brazil.

Lone Brazilian judges shut down Meta’s WhatsApp, the nation’s most widely used messaging app, several times in 2015 and 2016 due to the company’s refusal to comply with police requests for user data. In 2022, De Moraes threatened the messaging app Telegram with a nationwide shutdown, arguing it had repeatedly ignored Brazilian authorities’ requests to block profiles and provide information. He ordered Telegram to appoint a local representative; the company ultimately complied and stayed online.

X and its former incarnation, Twitter, have been banned in several countries — mostly authoritarian regimes such as Russia, China, Iran, Myanmar, North Korea, Venezuela and Turkmenistan. Other countries, such as Pakistan, Turkey and Egypt, have also temporarily suspended X, usually to quell dissent and unrest.

A search Friday on X showed hundreds of Brazilian users inquiring about VPNs that could potentially enable them to continue using the platform by making it appear they were logging on from outside the country. It was not immediately clear how Brazilian authorities would police this practice and impose fines cited by De Moraes.

“This is an unusual measure, but its main objective is to ensure that the court order to suspend the platform’s operation is, in fact, effective,” said Filipe Medon, a specialist in digital law and professor at the law school of Getulio Vargas Foundation, a university in Rio de Janeiro.

On Thursday evening, Starlink, Musk’s satellite internet service provider, said on X that De Moraes last week froze its finances, preventing it from doing any transactions in the country where it has more than 250,000 customers.

“This order is based on an unfounded determination that Starlink should be responsible for the fines levied — unconstitutionally — against X. It was issued in secret and without affording Starlink any of the due process of law guaranteed by the Constitution of Brazil. We intend to address the matter legally,” Starlink said in its statement. The law firm representing Starlink said the company appealed, but wouldn’t comment further.

Musk replied to people sharing the reports of the freeze, adding insults directed at De Moraes. “This guy @Alexandre is an outright criminal of the worst kind, masquerading as a judge,” he wrote.

Musk later posted on X that SpaceX, which runs Starlink, will provide free internet service in Brazil “until the matter is resolved” since “we cannot receive payment, but don’t want to cut anyone off.”

In his decision, De Moraes said he ordered the freezing of Starlink’s assets, as X didn’t have enough money in its accounts to cover mounting fines, and reasoning that the two companies are part of the same economic group.

While ordering X’s suspension followed warnings and fines, taking action against Starlink seems “highly questionable,” said Luca Belli, coordinator of the Getulio Vargas Foundation’s Technology and Society Center.

“Yes, of course, they have the same owner, Elon Musk, but it is discretionary to consider Starlink as part of the same economic group as Twitter (X). They have no connection, they have no integration,” Belli said.

Sá Pessoa and Savarese write for the Associated Press. AP writers Barbara Ortutay in San Francisco and David Biller in Rio de Janiero contributed to this report.