WhatsApp, owned by Facebook, appealed against the shutdown imposed on the company on Monday for not handing over information requested in a drug trafficking investigation.
The court rejected an initial appeal, but a second appeal was upheld, a spokesman for WhatsApp told AFP early on Tuesday afternoon.
“WhatsApp is now back online in Brazil!” Facebook co-founder and chief executive Mark Zuckerberg said in a post on his page at the leading online social network.
“Your voices have been heard once again. That said, the idea that everyone in Brazil can be denied the freedom to communicate the way they want is very scary in a democracy.”
The shutdown angered users reliant on the free app in Brazil, where cell phone fees for texting and calls are among the highest in the world.
Zuckerberg encouraged WhatsApp users to make their voices heard at an Internet Freedom Caucus event in Brasilia on Wednesday that will focus on introducing laws to prevent such Internet services from being blocked in Brazil.
“You and your friends can help make sure this never happens again, and I hope you get involved,” Zuckerberg said.
Rejecting the first appeal, the court said in a statement that WhatsApp was “playing down the importance of an investigation into members of a criminal organization who use the application.”
It accused WhatsApp of “covering up the seriousness of the crime allegedly committed — drug trafficking — with the argument of defending users’ right to privacy.”
WhatsApp had insisted it was cooperating with the investigation. Facebook has said it has no technical means for complying with such requests.
The court order from Judge Marcel Montalvao in the northeastern town of Lagarto shut down WhatsApp from 2:00 pm (1700 GMT) on Monday, ordering the cut-off for 72 hours.
The free app is installed on nine in 10 smartphones in the country. The company says it has more than 100 million users in Brazil.