A royal manor existed on the site of LInlithgow Palace in the 12th Century but was replaced by a fortification known as 'the Peel' in the 14th Century by English forces under Edward I. The site of the manor made it an ideal military base securing the supply routes between Edinburgh Castle and Stirling Castle.
After the town of Linlithgow was partially destroyed in a great fire in 1424, King James I started the rebuilding of the Palace as a grand residence for Scottish Royalty. Over the following century the palace developed into a formal courtyard structure, with significant additions by James III, James IV and James V, who was born in the palace in April 1512, and added the outer gateway and the elaborate courtyard fountain. Mary Queen of Scots was born here in December 1542 and occasionally stayed at the Palace during her reign.
After the Union of the Crowns in 1603 the Royal Court became largely based in England and Linlithgow was used very little.