Judge Xavier de Souza said the service should be re-instated immediately.
WhatsApp had been suspended for 48 hours on Thursday after the company failed to comply with a court order to provide investigators with information relating to a criminal court case.
Judge Souza said it was “not reasonable that millions of users be affected by the inertia of the company”.
Brazilians had complained bitterly on social media about the suspension of Whatsapp, which is a hugely popular app used by many to communicate with family, friends and colleagues both inside of Brazil and abroad.
Ninety-three per cent of the country’s internet population use Whatsapp, according to the TechCrunch website, with many young and poor Brazilians taking advantage of its free text message and internet telephone service.
Within hours of the ban being announced, the hashtag #Nessas48HorasEuVou (#Inthese48hoursIwill) began trending on Twitter, with Brazilians joking about all the things they would do during the suspension.
The suspension also caused anger at Facebook, which owns WhatsAppp.
Facebook chief executive Mark Zuckerberg had said he was “stunned” by the “extreme” ruling.