Relatives of Ademir Jorge Goncalves, 59, had identified him as the victim of a Sunday night car crash in Parana state in southern Brazil, police said.
As is customary in Brazil, the funeral was held the following day, which happened to be the holiday of Finados, when Brazilians visit cemeteries to honor the dead.
What family members didn't know was that Goncalves had spent the night at a truck stop talking with friends over drinks of a sugarcane liquor known as cachaca, his niece Rosa Sampaio told the O Globo newspaper. He did not get word about his own funeral until it was already happening Monday morning.
A police spokesman in the town of Santo Antonio da Platina said Goncalves rushed to the funeral to let family members know he was not dead.
"The corpse was badly disfigured, but dressed in similar clothing," said the police spokesman, who talked on condition of anonymity as he wasn't authorized to discuss the case. "People are afraid to look for very long when they identify bodies, and I think that is what happened in this case."
Sampaio told O Globo that some family members were not sure the body was Goncalves.
"My two uncles and I had doubts about the identification," she told O Globo. "But an aunt and four of his friends identified the body, so what were we to do? We went ahead with the funeral."
The police spokesman confirmed there were doubts: "His mom looked at the body in the casket and thought something was strange. She looked and looked and couldn't believe it was her son," Sampaio said. "Before long, the walking dead appeared at the funeral. It was a relief."
The body was correctly identified later Monday, the police spokesman said, and has already been buried in another state. He declined to release the actual victim's name.