Line Infantry Regiment (left) and Catalonia
Light Infantry Regiment (right)
Treaties of Tilsit, negotiated during a meeting in July 1807 between Emperors
Alexander I of Russia and
Napoleon, concluded the
War of the Fourth Coalition. With
Prussia shattered, and
Russia allied with
France, Napoleon expressed irritation that
Portugal was open to trade with the
 Pretexts were plentiful; Portugal was Britain's oldest ally in Europe, Britain was finding new opportunities for trade with Portugal's colony in
Royal Navy used
Lisbon's port in its operations against France, and he wanted to deny the British the use of the Portuguese fleet. Furthermore,
Prince John of Braganza, regent for his insane mother
Queen Maria I, had declined to join the emperor's
Continental System against British trade.
Events moved rapidly. The Emperor sent orders on 19 July 1807 to his Foreign Minister,
Talleyrand, to order Portugal to declare war on Britain, close its ports to British ships, detain British subjects on a provisional basis and sequester their goods. After a few days, a large force started concentrating at
 Meanwhile, the Portuguese government's resolve was stiffening, and shortly afterward Napoleon was once again told that Portugal would not go beyond its original agreements. Napoleon now had all the pretext that he needed, while his force, the First Corps of Observation of the Gironde with
General of Division
Jean-Andoche Junot in command, was prepared to march on Lisbon. After he received the Portuguese answer, he ordered Junot's corps to cross the frontier into
While all this was going on, the secret
Treaty of Fontainebleau had been signed between France and Spain. The document was drawn up by Napoleon's marshal of the palace
Géraud Duroc and Eugenio Izquierdo, an agent for
Manuel de Godoy, Prince of the Peace.
 The treaty proposed to carve up Portugal into three entities.
Porto (Oporto) and the northern part was to become the
Kingdom of Northern Lusitania, under
Charles Louis of Etruria. The southern portion, as the Principality of the Algarves, would fall to Godoy. The rump of the country, centered on Lisbon, was to be administered by the French.
 According to the Treaty of Fontainebleau, Junot's invasion force was to be supported by 25,500 Spanish troops.
 On 12 October, Junot's corps began crossing the
Bidasoa River into Spain at
 Junot was selected because he had served as ambassador to Portugal in 1805. He was known as a good fighter and an active officer, although he never exercised independent command.
By 1800, the Kingdom of Spain was in a state of social unrest. Townsfolk and peasants all over the country, who had been forced to bury family members in new municipal cemeteries, took back their bodies at night and tried to restore them to their old resting-places. In
Madrid, the growing
Francophilia of the court was opposed by the majos—shopkeepers, artisans, taverners and labourers who dressed in traditional style, and took pleasure in picking fights with petimetres.
Spain was an ally of Napoleon's First French Empire; however, defeat at the
Battle of Trafalgar in October 1805 had removed the reason for alliance with France. Godoy—who was a favourite of King
Charles IV of Spain—began to seek some form of escape. At the start of the War of the Fourth Coalition, which pitted the Kingdom of Prussia against Napoleon, Godoy issued a proclamation that was obviously aimed at France, even though it did not specify an enemy. After Napoleon's decisive victory at the
Battle of Jena-Auerstedt, Godoy quickly withdrew the proclamation. However, it was too late to avert the Emperor's suspicions. Napoleon planned from that moment to deal with his inconstant ally at some future time. In the meantime, the Emperor dragooned Godoy and Charles IV into providing a division of Spanish troops to serve in northern Europe.
Division of the North spent the winter of 1807–1808 in
Mecklenburg and towns of the old
Hanseatic League. Spanish troops marched into
Denmark in early 1808.
Invasion of Portugal
Concerned that Britain might intervene in Portugal or that the Portuguese might resist, Napoleon decided to speed up the invasion timetable, and instructed Junot to move west from
Alcántara along the
Tagus valley to Portugal, a distance of only 120 miles (193 km).
 On 19 November 1807, Junot set out for Lisbon and occupied it on 30 November.
The Prince Regent John escaped, loading his family, courtiers, state papers and treasure aboard the fleet. He was joined in flight by many nobles, merchants and others. With 15 warships and more than 20 transports, the fleet of refugees weighed anchor on 29 November and set sail for the colony of Brazil.
 The flight had been so chaotic that 14 carts loaded with treasure were left behind on the docks.
As one of Junot's first acts, the property of those who had fled to Brazil was sequestrated
 and a 100-million-
franc indemnity imposed.
 The army formed into a
Portuguese Legion, and went to northern Germany to perform garrison duty.
 Junot did his best to calm the situation by trying to keep his troops under control. While the Portuguese civil authorities were generally subservient toward their occupiers, the common people were angry.
 Nevertheless, the harsh taxes caused bitter resentment among the population. By January 1808, there were executions of persons who resisted the exactions of the French. The situation was dangerous, but it would need a trigger from outside to transform unrest into revolt.