The arrest comes as a debate over the access that law enforcement officials should get to tech companies’ data has escalated. In the United States, Apple is in a fight with the government over whether to build a special tool to help law enforcement break into an iPhone used by one of the attackers in a mass shooting in San Bernardino, Calif., last year.

In Brazil, Facebook has run into other hurdles with authorities in recent months over access to its information. Tuesday’s arrest comes less than three months after another judge ordered a temporary shutdown of WhatsApp in a similar case. An appeals court quickly overruled the shutdown.

The drug trafficking case that led to Tuesday’s arrest is a separate case, according to a spokeswoman at the courthouse in Sergipe. The Sergipe court said in a statement that it had given Facebook three previous chances to provide the information. Yet the issue echoes past instances, with Brazilian police and authorities contending that they should be able to access information in such investigations.

Facebook’s chief executive, Mark Zuckerberg, has long considered Brazil a crucial market and previously praised its Internet governance. He was one of a small group of Silicon Valley executives who met with President Dilma Rousseff of Brazil in a private meeting at Stanford University last July, according to individuals who attended.

Facebook on Tuesday said it was “disappointed with the extreme and disproportionate measure of having a Facebook executive escorted to a police station in connection with a case involving WhatsApp.”