During the War of the Spanish Succession he served as the second in command at the Battle of Schellenberg in 1704. In 1706 he led a brigade at Ramillies against the Allied forces under the command of the Duke of Marlborough. After being taken prisoner, he became involved in abortive negotiations for peace.