Brazil's arrest of a Facebook executive, however brief, casts a dark shadow on the debate between privacy and security.

The spotlight has recently shone on Apple and the company's tussle with U.S. law enforcement over encryption and user privacy. But in Latin America, the stakes over that same debate were just raised.

On Tuesday, Facebook Latin America VP Diego Dzodan was taken into custody in Brazil over what the government said was "repeated non-compliance with court orders" regarding the popular chat app WhatsApp, according to a CNet translation of the original police statement.

The executive was released just a day later on Wednesday, after a judge overturned the order, calling it "unlawful coercion," according to AFP. Judge Ruy Pinheiro said of the Facebook executive's detainment, "It seems to me that the extreme measure of imprisonment was hurried."

Brazil vs. WhatsApp

The Brazilian government has repeatedly requested access to communications over the social messaging app WhatsApp, which Facebook owns, to assist with criminal investigations. The Brazilian government insists traffickers have used WhatsApp, which provides encryption to users, to evade law enforcement.

"The investigation was required to produce evidence to be used in an organized crime and drug trafficking investigation," said Brazilian federal police in a statement about the arrest. As Latin Post reported, the police requested the information from WhatsApp three times before a Brazilian court ordered fines against the company, followed by the federal police's action to detain the Facebook executive.

Over the past few months, WhatsApp -- and Facebook by extension -- has refused to comply with repeated orders to expose communications within the network, in part because the company insists there are no technical means to decrypt the messages.

The back and forth between WhatsApp and the Brazilian government previously led to a temporary ban on the service in the country in December, which sparked outrage from Brazilians. The ban was overturned about 12 hours later.

In response to Dzodan's arrest, Facebook stated that 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, which operates separately from Facebook," adding, "Facebook has always been and will be available to address any questions Brazilian authorities may have."

Fight Between Tech and Governments

On U.S. soil, Facebook has expressed support for Apple in its fight against the FBI's order for the company to provide a backdoor to the iPhone used by the San Bernardino shooters. Facebook is expected to file an amicus brief in court this week in support of Apple, flanked by other tech giants like Google, Twitter and Microsoft.

While the U.S. government hasn't taken to measures as extreme as those in Brazil, the fight in South America over encryption, privacy and government spying power echoes the row between Apple and the FBI. The incident casts a pall over the American proceedings, showing that the privacy debate isn't limited to one country. It also indicates how far other governments may go to exercise their power to compel compliance in investigations.

But as Bloomberg noted, the two cases are intertwined in messier, contradictory ways as well. WhatsApp's failure to comply with requests for user data violated Brazilian law and led to Dzodan's arrest, but at the same time, complying with those requests would violate U.S. wiretapping law.