San Luis Potosí, San Luis Potosí
He was born in San Luis Potosí, San Luis Potosí to Spanish soldier José María González Yáñez and Francisca Bocanegra y Villalpando, sister of the Foreign Relations Secretary under President Vicente Guerrero, José María Bocanegra. Despite his father being exempted because of being married to a Mexican, in 1827, his family moved to Spain after a law was enacted expelling all remaining Spanish citizens in the country. They settled in the port of Cádiz until the family returned to San Luis Potosí on December 28, 1836.