The top forensic official in Mexico's Jalisco state has been fired after it emerged some 150 corpses were being stored in a refrigerated trailer because local mortuaries were full.
But Luis Octavio Cotero denied he was responsible for the storage of the unclaimed bodies, and accused the state government of making him a scapegoat.
The trailer was spotted in at least two areas of Guadalajara city.
Its contents became known when nearby residents complained of the smell.
'It could make us all sick'
"We have a lot of children in this neighbourhood... it could make us all sick," resident José Luis Tovar said.
Laws in Mexico prevent the cremation of bodies linked to violent crime until investigations have concluded and the case is closed.
Local authorities said they were looking for a longer-term solution to store the bodies following a recent wave of violence.
Jalisco state spokesman Gonzalez Sánchez told local radio that Mr Cotero was dismissed because he failed to take responsibility for storing the bodies, Reuters news agency reports.
But Mr Cotero was quoted by the Excelsior newspaper as saying the decision to rent the trailer had been made by the office of the state attorney general two years ago, as a temporary solution to handle the growing number of bodies. He also said there was a second trailer that contained a further 150 bodies.
He told Reuters he believed he was being made a scapegoat because he had questioned the investigation into the disappearance of three film students earlier this year.
"Only now are they looking around ... It's inefficacy that has put our state in such a sorry position," he said.
The refrigerated trailer had previously been parked at a warehouse in the neighbourhood of Duraznera, on the outskirts of Guadalajara, but after two weeks the residents began to complain of a foul stench and said the container was attracting flies.
It was then moved to an empty lot in the suburb of Tlajomulco de Zúñiga, but residents there began to protest at the weekend.
"We don't want it here. They need to put it somewhere else, it stinks," Mr Tovar said.
Mexico has suffered a wave of violent killings in recent years.
More than 200,000 people have been killed or have disappeared since December 2006, when Mexico's government declared war on organised crime.
Mexico experienced its most violent year in 2017 with more than 25,000 murders, official figures suggest. It is the highest annual tally since modern records began. Organised crime accounted for nearly three-quarters of those murders.