Saint-Germain-en-Laye was founded in 1020 when King Robert the Pious (ruled 996-1031) founded a convent on the site of the present Church of Saint-Germain. Prior to the French Revolution in 1789, it had been a royal town and the residence of numerous French monarchs.
The old castle was constructed in 1348 by King Charles V on the foundations of an old castle dating from the time of Saint Louis in 1238. François I was responsible for its subsequent restoration, and then kings Henri IV and Louis XIII left their mark on the town.
Louis XIV established Saint-Germain-en-Laye as his principal residence from 1661 to 1681. Louis XIV turned over the château to King James II after his exile from Britain. King James lived in the Chateau for 13 years and his daughter Marie-Louise Stuart was born in exile here in 1692. King James Stuart is buried in the Church of Saint-Germain.
During the French Revolution, the name was changed along with many other places whose names held connotations of religion or royalty. Saint-Germain-en-Laye became Montagne-du-Bon-Air.
In the 19th century, Napoleon I established his cavalry officers training school in the Chateau-Vieux. In 1867, Napoleon III set up the Musée des Antiquités Nationales. This museum has exhibits ranging from Paleolithic to Celtic times.