BERLIN — Twitter waded into potentially perilous territory on Thursday when it blocked users in Germany from access to the account of a neo-Nazi group that is banned by the government here.

The move was the first time that Twitter acted on a policy known as “country-withheld content,” announced in January, in which it will block an account at the request of a government. But the company cracked open the gates to a complex new era in which it will increasingly have to referee legal challenges to the deluge of posts that has made the site so popular.

The company said the goal was to balance freedom of expression with compliance with local laws. “Never want to withhold content; good to have tools to do it narrowly & transparently,” Alexander Macgillivray, the company’s chief lawyer, wrote on Twitter.

A German spokesman for the company confirmed in an e-mail that it was the first time the policy had been used, although Twitter does not as a matter of policy announce government requests to block an account. In a “transparency report” issued earlier this year, the company said it had received six such requests but had not, for reasons it did not specify, acted upon them.