The colonies were part of the First French Empire as part of Napoleon's invasion and occupation of Spain, until Joseph Bonaparte's abdication on December 11, 1813, following the aftermath of the Battle of Vitoria and the invasion of France through Spain by the Duke of Wellington.