Hospital officials said a total of 30 villagers were suffering from food poisoning.
They were helping with the funeral of a villager, named Lu Baode, in Bazhou district of Bazhong city.
Lu's family offered them breakfast. Later, some villagers developed symptoms of dizziness, nausea, vomiting and stomachache, state-run Xinhua news agency reported.
Two of them died in hospital while three others are still being treated in the Intensive Care Unit (ICU).