Facebook Latin America vice president Diego Dzodan

A Brazilian judge ordered the release Wednesday of Facebook's vice president for Latin America, a day after he was arrested for refusing to hand over WhatsApp messages to the police investigating a drugs case.

The judge, Ruy Pinheiro, considered the detention of Diego Dzodan in Sao Paulo "extreme," the court in Sergipe state said in a statement.

Facebook, which owns the popular WhatsApp mobile phone messaging tool, denies it has tried to obstruct the police investigation.