During the French invasion of Andalusia in January 1810, Venegas was military governor of Cádiz. Before the powerful invading army, the Spanish defenders rapidly collapsed and the Supreme Central Junta fled to Cádiz. José María de la Cueva, 14th Duke of Alburquerque was able to bring 12,000 troops to reinforce the weak Cádiz garrison. In the crisis, Venegas ensured that all boats in nearby waters were transferred to Cádiz and ordered the demolition of all forts on the Isla del Trocadero and the adjacent peninsula to prevent their use by the enemy. A squabble arose between Venegas and Alburquerque over who was the superior officer. This problem was resolved when the Junta appointed Venegas to the position Viceroy of New Spain and gave Alburquerque command of Cádiz.