 In 1838, Antigua Guatemala, Chiquimula and Salamá withdrew recognition of his government, and in February of that year Rafael Carrera's revolutionary forces entered Guatemala City asking for the Cathedral to be opened to restore order in the catholic communities, obliging Gálvez to relinquish power.Gálvez remained in the city after he lost power.Gálvez died on March 29, 1862 in Mexico and was buried in the Cemetery of San Fernando.