Villagers threw 17-year-old Santos Ramos into the open grave after he was identified as a possible culprit in the attack on Leandra Arias Janco in the southern highlands of Bolivia, prosecutor Jose Luis Barrios said.
The Associated Press cites a source who claims Ramos was tied up at the 35-year-old woman’s funeral and then thrown into the open grave in Colquechaca, 400 miles south of La Paz.
The woman’s coffin was then placed on top of him and the grave was filled with earth, it added.
Ramos was a peasant, the AFP reports, adding the region's small police force was unable to contain the crowd of "about 100 people" thought to be involved.
Police and judicial workers are scarce in rural areas of Bolivia where residents often take justice into their own hands, making killings and lynchings not uncommon.
In 2009 President Evo Morales approved a law extending institutional recognition of "indigenous justice".
But as The Economist points out, "Community justice can sometime resemble legalised lynching, featuring stoning, strangulation or burning with petrol. The police do not keep separate records of these acts."
In May last year a Bolivian police officer was lynched by a mob after he was confused with a thief in the city of El Alto, which is adjacent to La Paz, the Latin American Herald Tribune reported.