The hugely popular WhatsApp smartphone messaging service was briefly blocked by a Brazilian court Tuesday for the third time in less than a year after failing to surrender user data to police.

The latest drama ended after the Supreme Court president, Ricardo Lewandowski, accepted an appeal against a lower court order that shut down the service nearly four hours earlier.

"The suspension of service apparently violates the fundamental precept of freedom of expression and communication," the Supreme Court said, adding that Lewandowski found that the lower court judge's decision seemed "not very reasonable and not very proportional."

WhatsApp gradually resumed normal service after the high court's ruling.

This had been the fourth court-ordered suspension of WhatsApp, which is owned by social media giant Facebook, since February 2015 and the third in the last 12 months.

READ: Brazil to end WhatsApp shutdown: company

READ: Brazil arrests Facebook executive in row over police access to data

The long-running dispute pits Brazilian authorities' insistence that they need access to communications between alleged criminals against Facebook's argument that it is protecting privacy and freedom of communication.

In the last incident, in May, the blockage lasted a day before being lifted on appeal.

The shutdowns have angered users reliant on the free app. Cell phone fees for texting and calls are high in Brazil and WhatsApp's group chat and image-sharing functions have become embedded in everyday social interaction.

"We hope that this puts an end to blocks that have punished millions of Brazilians and that people can continue using services like WhatsApp to stay in touch with those who matter to them," the company said in a statement.


Nationwide block

Earlier, lower court Judge Daniela Barbosa had ordered telecom companies to put an immediate nationwide stop to WhatsApp services.

Barbosa blasted Facebook as irresponsible for refusing "to provide information that will be critical to the success of an investigation and later to bolster the criminal case."

It was not clear what was involved in the criminal case, but Barbosa said Facebook had been issued with three requests to provide messages to police investigators in Duque de Caxias, north of Rio de Janeiro. The 19-page court ruling said Facebook must comply or face fines of 50,000 reais ($15,265) a day.

READ: What's up, no WhatsApp? Brazilians peeved after service suspended

READ: Brazil court orders 48-hour WhatsApp block

WhatsApp was defiant, calling the order an "indiscriminate" threat to "people's ability to communicate, to run their businesses and to live their lives."

The company said it hoped "to see this block lifted as soon as possible."


Judge's anger

Billionaire Facebook CEO Mark Zuckerberg called the May shutdown "very scary in a democracy."

But in the latest ruling, Barbosa criticized Facebook's attitude, saying the company responded to Brazilian police with its own list of questions demanding explanations, adding that these were made in English, as if Brazil were "some small republic."

The judge said those mourning the loss of WhatsApp "should remember that the main victim of the crimes being investigated is society itself, with the certainty that all the time, new victims are being created and new crimes are being committed while the judiciary is unable to stop the incidents or punish those responsible."

WhatsApp responded in its statement that it doesn't comply in revealing the encrypted communications because "we cannot share information we don't have access to."

WhatsApp is estimated to be used by 100 million Brazilians, making Brazil the second biggest user country after South Africa, according to data cited by the court.