At the assembly of Bayonne in 1808, he was one of the most prominent of those who accepted the new constitution from Joseph Bonaparte as King of Spain. After the national rising against French aggression, and the defeat of General Dupont at Bailen in 1808, Álava joined the national independence party, who were fighting in alliance with the British forces in the peninsula. At the end of January 1810 he was ordered to move to Portugal in order to communicate Wellington the difficult military situation in that they were against the French. During this stay a friendship between Wellington and Alava was created, to the point that the Duke had him remain as delegate of the Spanish forces in the British units. He was promoted to Brigadier by express recommendation of Wellington. He saw action in the battles of Salamanca, Vitoria, Bussaco and at the Siege of Ciudad Rodrigo, as well as taking part in the storming of Badajoz.