In late 1807, Junot led a small army in the initially successful invasion of Portugal. The French troops were isolated there when the Peninsular War broke out first in Spain, then in Portugal. After being defeated by the British at the Battle of Vimeiro, Junot's army was repatriated to France following the Convention of Cintra, signed on 22 August 1808. Upon return, the troops became the VIII Corps under Junot with three divisions. On 10 October, there were 25,730 men on the muster rolls of whom 2,137 were detached and 3,523 were in hospital. The corps had only a brief existence before being dissolved in December 1808. Junot's cavalry units were provisional; these were dispersed to join their regular regiments. Loison's 2nd Division was entirely broken up and distributed to other corps. General Étienne Heudelet de Bierre's 3rd Division became the 4th Division of Soult's II Corps. General Henri François Delaborde's 1st Division became the 3rd Division of II Corps.