After this, Lannes was to be tested as a commander-in-chief, for Napoleon sent him to Spain in 1808 and gave him a detached wing of the army to command, with which he won a crushing victory over General Francisco Castaños at Tudela on 22 November. In January 1809, he was sent to capture Zaragoza, and by 21 February, after one of the most stubborn defences in history, Lannes was in possession of the place. He later said, "this damned Bonaparte is going to get us all killed" after his last campaign in Spain. In 1808, Napoleon made him Duke of Montebello, and in 1809, for the last time, gave him command of the advance guard. He took part in the engagements around Eckmühl and the advance on Vienna. With his corps, he led the French Army across the Danube River and bore the brunt, with Marshal André Masséna, at the Battle of Aspern-Essling.