At the side of his maternal grandfather, Pedro de Leyva y Mendoza, capitan general of the galleys of Spain, Naples and Sicily, he entered the service of the Crown at a young age in the navy.
In 1662 the viceroy ordered a change in the route of the procession of Corpus so that it would pass in front of the palace, where his wife could view it from her balcony.
The chapter of the cathedral made strong protests, and the Court not only disapproved the viceroy's decision, but also fined him twelve thousand ducats.
He seized lands and properties to give them to his family and friends and to cover a loan of 200,000 pesos the treasury of New Spain had advanced to the Spanish Crown.
Also in 1662 he seized the merchandise arriving in Veracruz from Europe in order to require the Mexico City merchants for whom it was intended to contribute immediately to the funds he was remitting to Spain.
De Leyva's departure from the capital was humiliating, accompanied by whistles, catcalls and stone-throwing, but also by the great relief of the people he had antagonized.