During the Peninsular War, Napoleon appointed Masséna as Commander of the Army of Portugal in 1810. Masséna captured Ciudad Rodrigo and Almeida after successful sieges, but suffered a setback at the hands of the Duke of Wellington's Anglo-Portuguese army at Buçaco on 27 September. Pressing on, he forced the allies to retreat into the Lines of Torres Vedras, where a stalemate ensued for several months. Finally forced to retreat due to lack of food and supplies, Masséna withdrew to the Spanish frontier, allegedly prompting Napoleon to comment, "So, Prince of Essling, you are no longer Masséna." After suffering defeats at the battles of Sabugal and Fuentes de Oñoro, he was replaced by Marshal Auguste de Marmont and did not serve again, becoming a local commander at Marseille.