The chief justice of Brazil's Supreme Court quickly struck down a lower court decision that had blocked the WhatsApp messaging service nationwide for several hours Tuesday, affecting almost 100 million users.

Chief Justice Ricardo Lewandowski ruled on a motion filed by a political party seeking to have the Rio de Janeiro judge's order thrown out.

Early in the day, Judge Daniela Barbosa ordered the suspension because Facebook, WhatsApp's parent company, would not help a police investigation. The app was suspended at 2 p.m. local time.

Lewandowski ruled after the service had been blacked out almost four hours. Telecom operators said they were waiting to be notified formally so they could put the messaging system online in Brazil.

In her decision, Barbosa said Facebook showed "total disrespect for Brazilian laws." She argued that the company was repeatedly asked to intercept messages sent through the service to help in a criminal investigation in the city of Caxias, outside Rio.

WhatsApp CEO Jan Koum had said the company was working to get the app running again. "It's shocking that less than two months after Brazilian people and lawmakers loudly rejected blocks of services like WhatsApp, history is repeating itself," Koum said on his Facebook page.

Justice Minister Alexandre de Moraes also said he wanted a solution that would prevent decisions like Barbosa's.

It was at least the third such ruling against WhatsApp this year in Brazil. A judge in the northeastern state of Alagoas blocked the app over a separate investigation in February, and WhatsApp was blocked in Sao Paulo for 12 hours in December by a judge in that region.

After Barbosa's ruling took effect, the website of the court where she sits went offline. The activist group Anonymous Brasil claimed it knocked out the site as a "protest against WhatsApp being blocked."