 After obtaining his law degree, Mendoza moved to Barinas, where he became known for defending local tribal groups and helping invest their profits in several agricultural properties.In January 1807, he was elected Mayor of Barinas by the Council of Barinas.After charges of nepotism in the election process that had led to Mendoza's appointment, the Royal Court ruled in favor of Mendoza retaining the governorship in 1808.