Facebook senior executive Diego Dzodan was released from jail in Brazil Wednesday after being detained for defying a court order to release data from messaging app WhatsApp.

The detention, which lasted nearly 24 hours, was “unlawful coercion,” Judge Ruy Pinheiro ruled. “It seems to me that the extreme measure of imprisonment was hurried,” Pinheiro said in a statement, according to AFP.

A lower court in Brazil had ruled that Dzodan, who is Facebook’s vice president for Latin America, should be arrested on account of repeated refusals to hand over data related to a drug investigation, as demanded by the courts.

Facebook called the arrest “extreme” in a statement released Tuesday at the time of the arrest and again on Wednesday after his release. “Diego's detention was an extreme, disproportionate measure, and we are pleased to see the court in Sergipe issue an injunction ordering his release," a Facebook representative said in a statement Wednesday morning. 

"Arresting people with no connection to a pending law enforcement investigation is a capricious step, and we are concerned about the effects for the people of Brazil and innovation in the country. We remain willing to address questions Brazilian authorities may have," the statement read.

Indeed, Latin America and Brazil, specifically, are fast-growing markets for WhatsApp's parent company Facebook. A recent eMarketer report revealed that Facebook is the top social network in Latin America, according to comScore data. Facebook reached 218 million people in Latin America last year, and that is expected to rise to 241 million, eMarketer reported this week.

Facebook's WhatsApp boasts 1 billion monthly active users, and 66 percent of internet users in Latin America used the app in December 2015, according to data from Statista

Brazilian police said the data was needed for evidence in an organized crime and drug trafficking investigation. Authorities declined to provide more information on the request, saying that doing so would would compromise a current investigation, Reuters reported. Starting two months back, authorities fined Facebook for refusing to comply at about $12,500 per day. Last month, the fee was raised twentyfold to $250,000 per day, the AFP reported.

On Tuesday, Facebook said it lacks the means to meet the request. “WhatsApp cannot provide information we do not have,” a statement read. WhatsApp has boasted end-to-end encryption since 2014, meaning that the company cannot read messages sent across its network.

This incident is the second time in recent months WhatsApp has resisted a Brazilian court. In December, a judge ordered a 12-hour suspension of WhatsApp after the company did not provide data for a separate criminal investigation. The decision was overturned on appeal.

The demands from Brazil on Facebook come while Apple is fighting a landmark user privacy case in the United States. Apple is refusing a demand from the FBI to create custom software that would allow the bureau to access the iPhone of Syed Rizwan Farook, an assailant in the Dec. 2 attack in San Bernardino, California.

Shortly after Apple CEO Tim Cook announced his decision to resist the request, WhatsApp CEO Jan Koum shared his solidarity. “I have always admired Tim Cook for his stance on privacy and Apple's efforts to protect user data and couldn't agree more with everything said in their customer letter today,” Koum wrote on Facebook. “We must not allow this dangerous precedent to be set. Today our freedom and our liberty is at stake."