For the next four years, Soult remained in Spain engaged in the Peninsular War. In 1809, he invaded Portugal and took Porto, but was isolated by General Francisco da Silveira's strategy of contention. Busying himself with the political settlement of his conquests in French interests and, as he hoped, for his own ultimate benefit as a possible candidate for the Portuguese throne, he attracted the hatred of Republican officers in his army. Unable to move, he was eventually driven from Portugal in the Second Battle of Porto by Lieutenant-General Sir Arthur Wellesley (later made Duke of Wellington), making a painful and almost disastrous retreat over the mountains, pursued by General William Beresford and Silveira. After the Battle of Talavera, Soult was made chief of staff of French forces in Spain with extended powers, and on 19 November 1809, won a great victory at the Battle of Ocana.