In 1809, Wellesley was appointed ambassador to Spain. He landed at Cádiz just after the Battle of Talavera, and tried unsuccessfully to bring the Spanish government into effective co-operation with his brother, who, through the failure of his allies, had been forced to retreat into Portugal. A few months later, after the duel between George Canning and Robert Stewart, Viscount Castlereagh, and the resignation of both, Wellesley accepted the post of Foreign Secretary in Spencer Perceval's cabinet. Unlike his brother Arthur, he was an eloquent speaker, but was subject to inexplicable "black-outs" when he was apparently unaware of his surroundings.