X began to go dark across Brazil on Saturday after the nation’s Supreme Court blocked the social network because its owner, Elon Musk, refused to comply with court orders to suspend certain accounts.

The moment posed one of the biggest tests yet of the billionaire’s efforts to transform the site into a digital town square where just about anything goes.

Alexandre de Moraes, a Brazilian Supreme Court justice, ordered Brazil’s telecom agency to block access to X across the nation of 200 million because the company lacked a physical presence in Brazil.

Mr. Musk closed X’s office in Brazil last week after Justice Moraes threatened arrests for ignoring his orders to remove X accounts that he said broke Brazilian laws.

X said that it viewed Justice Moraes’s sealed orders as illegal and that it planned to publish them. “Free speech is the bedrock of democracy and an unelected pseudo-judge in Brazil is destroying it for political purposes,” Mr. Musk said on Friday.

In a highly unusual move, Justice Moraes also said that any person in Brazil who tried to still use X via common privacy software called a virtual private network, or VPN, could be fined nearly $9,000 a day.