After the Battle of Trafalgar in 1805, in which the Franco-Spanish fleet lost to Britain, the government of Portugal restored relations with its old ally. This led France to declare the Peace of Badajoz treaty cancelled, again marching on Portugal and invading it, starting the Peninsular War, that lasted from 1807 to 1814.
