X, formerly Twitter, has been banned in Brazil after failing to meet a deadline set by a Supreme Court judge to name a new legal representative in the country.
Alexandre de Moraes ordered the "immediate and complete suspension" of the social media platform until it complies with all court orders and pays existing fines, reports BBC.
The row began in April, with the judge ordering the suspension of dozens of X accounts for allegedly spreading disinformation.
Reacting to the decision, X owner Elon Musk said: "Free speech is the bedrock of democracy and an unelected pseudo-judge in Brazil is destroying it for political purposes."
It is the latest in a series of rows involving Musk - he has clashed with the with EU over the regulation of X and earlier this month became embroiled in a war of words with UK Prime Minister Sir Keir Starmer.
The head of Brazil's telecommunications agency, which has been tasked with suspending the platform, said he is "proceeding with the compliance" to do so, according to Reuters news agency.
The platform is expected to be unavailable in the country within the next 24 hours.
Justice Moraes has given companies such as Apple and Google a five-day deadline to remove X from its application stores and block its use on iOS and Android systems.
He added that people or businesses using means such as VPNs (virtual private network) to access the platform could be fined R$50,000 (£6.7k).
According to the judge's order, a ban will be in effect until X names a new legal representative in the country and pays fines for violating Brazilian law.
In a previous post from one of its official accounts, X had said it would not comply with the demands.
"Soon, we expect Judge Alexandre de Moraes will order X to be shut down in Brazil - simply because we would not comply with his illegal orders to censor his political opponents," the post said.
"The fundamental issue at stake here is that Judge de Moraes demands we break Brazil’s own laws. We simply won’t do that."
Justice Moraes had ordered that X accounts accused of spreading disinformation - many supporters of the former right-wing president Jair Bolsonaro - must be blocked while they are under investigation.
He said the company's legal representatives would be held liable if any accounts were reactivated.
Meanwhile, the bank accounts of Musk's satellite internet firm Starlink have been frozen in Brazil following an earlier order by the country's Supreme Court.
Starlink responded with a post on X which said the "order is based on an unfounded determination that Starlink should be responsible for the fines levied - unconstitutionally - against X."
Musk also said on X that "SpaceX and X are two completely different companies with different shareholders."
Starlink is a subsidiary of Mr Musk's rocket firm SpaceX.
In 2022, the government of then-President Bolsonaro gave Starlink the green light to operate in Brazil.
As South America's largest country, Brazil and its remote regions in the Amazon have huge potential for Starlink, which specialises in providing internet services to isolated areas.
Justice Moraes gained prominence after his decisions to restrict social media platforms in the country.
He is also investigating Bolsonaro and his supporters for their roles in an alleged attempted coup on 8 January last year.
X is not the first social media company to come under pressure from authorities in Brazil.
Last year, Telegram was temporarily banned over its failure to cooperate with requests to block certain profiles.
Meta's messaging service Whatsapp also faced temporary bans in 2015 and 2016 for refusing to comply with police requests for user data.