Oscar Otero Aguilar, who worked in a pet shop, is said to have been drinking with friends in Medero, in the north of the capital, Mexico City, when the accident happened.
A follower of the “selfie” craze – in which people pose for photographs they take of themselves – Otero Aguilar frequently posted pictures of himself on social media sites.
He had been at home with with his two housemates, Omar Abner Campos Vives and man known only as “El Paco,” when neighbours heard a gun go off followed by screaming.
One neighbour, Manfredo Paez Paez, 57, said: ”I heard a gunshot, and then I heard somebody screaming and realised somebody had been hurt. I called the police straight away and when they arrived they found that he was still alive.”
Mr Otero Aguilar was discovered with a gunshot wound to the head, and succumbed to his injuries while being taken to hospital by ambulance. An autopsy has been scheduled.
Campos Vives, who was arrested at the apartment, told police Mr Otero Aguiar had been playing around with the borrowed gun and decided to take a selfie without realising it was loaded. Police are now seeking El Paco, who fled when they arrived.
The Ministry of Public Security told Proceso Mr Otero Aguilar’s death appeared to be an accident, with the “selfie” due to be posted to Facebook.
Previous snaps on his Facebook site show him posing with alcoholic drinks, cars, motorbikes and a number of attractive women.