SÃO PAULO—A Brazilian judge lifted a temporary ban on Facebook Inc.’s WhatsApp throughout Brazil on Thursday, a day after a different judge ordered the messaging service be blocked for 48 hours.

The block, which began at midnight, disrupted the lives of tens of millions of Brazilians who use the free messaging service and caused many to look for alternatives. A judge in São Paulo state lifted the block, saying, “it does not seem reasonable that millions of users are affected” because WhatsApp had not cooperated with a criminal investigation. The judge recommended fining the company instead.

WhatsApp is hugely popular in Brazil, where roughly half of the country’s 200 million people use its free text and voice messaging functions regularly. Many poorer Brazilians depend exclusively on WhatsApp for their day-to-day communications. It was the most downloaded app last year, in the world’s fourth-largest smartphone market. According to Facebook, more than 100 million Brazilians use WhatsApp.

“I went crazy when they canceled WhatsApp, because I wasn’t able to contact my girlfriends or my family,” said Wellington de Souza, 25 years old, who works in a Japanese restaurant in São Paulo. “Only now when I was without WhatsApp I realized that I’m addicted. It’s impossible to live without [it].”

After the service was restored, WhatsApp co-founder Jan Koum said in a Facebook post that getting WhatsApp back online was “a victory for the Brazilian people, and we’re glad that your voices were heard loud and clear by people who represent them.”