Napoleon then went back to the west, to deal with Britain. Only two countries remained neutral in the war: Sweden and Portugal, and Napoleon then looked toward the latter. In the Treaty of Fontainebleau, a Franco-Spanish alliance against Portugal was sealed as Spain eyed Portuguese territories. French armies entered Spain in order to attack Portugal, but then seized Spanish fortresses and took over the kingdom by surprise. Joseph Bonaparte, Napoleon's brother, was made King of Spain after Charles IV abdicated. This occupation of the Iberian peninsula fueled local nationalism, and soon the Spanish and Portuguese fought the French using guerrilla tactics, defeating the French forces at the Battle of Bailén (June and July 1808). Britain sent a short-lived ground support force to Portugal, and French forces evacuated Portugal as defined in the Convention of Sintra following the Allied victory at Vimeiro (21 August 1808). France only controlled Catalonia and Navarre and could have been definitely expelled from the Iberian peninsula had the Spanish armies attacked again, but the Spanish did not.