MEXICO CITY — Authorities said Friday that a mob of about 100 people in the central Mexican state of Hidalgo doused a detective with gasoline and burned him to death.

The Hidalgo state prosecutors' office said the crowd attacked local police in the town of Metepec on Thursday and took the detective and three other men captive.

They severely beat the men and burned the detective after dousing him with fuel. It was unclear if he was on duty or if they knew he was a detective.

Video posted on social media sites showed a mob kicking one of the men in the town square and beating him with cudgels and fists. Police eventually arrived to rescue him and two others.

The mob was reportedly roused by rumors that the men were planning to abduct children.

The prosecutors' office said it was investigating and would bring the killers and other members of the mob to justice.

"Let it be clear, inciting or promoting these kind of acts is also a crime," the office said.

In similar cases, prosecutors have been able to identify and arrest suspects because townspeople often record attacks on their cellphones and post videos online.

There have been five killings in the span of about a month in Mexico based on false rumors about child snatchers. In four of those cases, the victims were also burned.

Authorities say the rumors circulate on social media and have asked the public not to believe them.

But the country's human rights commission faulted authorities. A lack of effective law enforcement and rising crime has led some communities to form vigilante squads, and passengers on buses in the greater Mexico City area regularly kill thieves who get on board to rob them.

"As long as the government does not provide minimal conditions of safety for the population, the lack of confidence in the government and people's desperation for justice will open the door for more cases of people taking the law into their own hands," the agency said in a statement earlier this month.

It is not the first time that investigative agents have been killed in Mexico by townspeople.

In 2004, a mob on the southern outskirts of Mexico City beat two federal agents and burned them to death for allegedly taking pictures of school children. Some claimed they believed the agents were kidnappers, but it turned out that they were investigating a case on assignment.

The hysteria has also swept up people who were simply asking questions.

In late August, two men were set afire by an angry mob in Puebla after they apparently stopped to have beer near a school.

In 2015, residents of Ajalpan, Puebla also beat to death two young men who were making inquiries in the town.

Rumors spread that they were trying to kidnap children, but they were actually conducting a commercial survey about tortilla consumption.