Dunfermline Palace

Dunfermline Palace is a ruined former Scottish royal palace and important tourist attraction in Dunfermline, Fife, Scotland. It is currently, along with other buildings of the adjacent Dunfermline Abbey, under the care of Historic Environment Scotland as a scheduled monument.
Origins.
Dunfermline was a favourite residence of many Scottish monarchs. Documented history of royal residence there begins in the 11th century with Malcolm III who made it his capital. His seat was the nearby Malcolm's Tower, a few hundred yards to the west of the later palace. In the medieval period David II and James I of Scotland were both born at Dunfermline. 
Dunfermline Palace is attached to the historic Dunfermline Abbey, occupying a site between the abbey and deep gorge to the south. It is connected to the former monastic residential quarters of the abbey via a gatehouse above a pend (or "yett"), one of Dunfermline's medieval gates. The building therefore occupies what was originally the guest house of the abbey. However, its remains largely reflect the form in which the building was remodelled by James IV around 1500. 
History.
James IV.
In November 1504 Margaret Tudor was in residence when two people were suspected of having plague. James IV was away in the north of Scotland. The queen left for Edinburgh with her household servants , including African women known as the "More lasses", who went first to Inverkeithing. This was a false alarm. Throughout the sixteenth century, Scotland's monarchs and royal family members were frequently in residence.
On 14 June 1562 after dinner at Dunfermline, Mary, Queen of Scots produced a gold ring set with a heart shaped diamond and declared she would send it to Elizabeth with some verses she had written herself in Italian. At this time a meeting of the two queens was discussed.
Anne of Denmark and Prince Charles.
James VI stayed at Dunfermline Palace in June 1585 to avoid the plague which raged in Edinburgh. He had a proclamation made to regulate the prices of food, drink, and lodgings for his courtiers in Dunfermline town. In 1589 the palace was given as a wedding present by the king to his bride Anne of Denmark. She gave birth to three of their children in the Palace; Elizabeth (1596), Charles (1600) and Robert (1602), attended by her German physician, Martin Schöner.
The palace staff included the keeper John Gibb, the chamberlains of the estates David Seton of Parbroath, William Schaw, and Henry Wardlaw of Pitreavie, the gardener John Lowrie, the plumber James Coupar, who fixed the lead roofs, and Thomas Walwood, foreman of the coal pits. She was entertained by an English musician John Norlie and her fool Tom Durie. Later, a story circulated that Tom Durie had stumbled on the queen holding a secret Mass at the palace.
Anne of Denmark had a new building built at the Palace completed in 1600, and known as the "Queen's House", or "Queen Anna of Denmark House". This tall building had a driveway known as a "pend" running through its basement level, replacing an earlier gateway. In November 1601 she prepared a lodging for her daughter Princess Elizabeth, but the princess remained at Linlithgow Palace on the king's orders. There was a steep stairwell outside Anne of Denmark's bed chamber, and in March 1602 the English courtier Roger Aston fell down it and was unconscious for three hours.
After the Union of Crowns in 1603, the removal of the Scottish court to London meant that the building came to be rarely visited by a monarch. Prince Charles stayed at Dunfermline for a year in the care of Alexander Seton, 1st Earl of Dunfermline after his mother had gone to England. Jean Drummond, later Countess of Roxburghe had looked after him and an older woman, Marion Hepburn, had been in charge of rocking his cradle. The Prince was slow to learn to walk and was provided with an oak stool with wheels to train him.
An English courtier, Robert Carey came to Dunfermline and stayed with Alexander Seton, and wrote that Prince Charles was "a very weak child". Dr Henry Atkins wrote from Dunfermline in July 1604 to Anna of Denmark, saying that Prince Charles could now walk the length of the "great chamber" or "longest chamber" several times daily without a stick. Seton and his wife Grizel Leslie brought Prince Charles to England in September 1604, and he was lodged at Oatlands Palace. Robert Carey and his wife Elizabeth were appointed to look after him. Some of the Prince's old servants from Dumfermline went to England and were given pensions, including Marion Hepburn, the seamstress Joan Drummond, the laundress Agnes Fortune, the chamber door keeper George Kirke, and the cook John Lyle.
Ten tapestries from the royal tapestry collection were still at Dunfermline Palace in 1616, left from the time the infant Prince Charles resided at the Palace. In 1618 John Taylor, the Water Poet, lodged for a night at the house of the keeper since 1584, John Gibb, which was presumably a part of the palace. Taylor described the site, "the Queenes Palace, a delicate and princely mansion, withall I saw the ruins of an ancient and stately built Abbey, with fair gardens, orchards, meadows, belonging to the Palace."
When Anne of Denmark died in 1619 ownership of the palace passed to Prince Charles. A new great seal of the lordship was made and the "new great house" built by his mother was repaired. The town was devastated by a fire on 25 May 1624 and Prince Charles sent £500 sterling in aid.
Charles I and Charles II.
Charles I returned to Scotland in 1633 for his coronation but only made a brief visit to his place of birth. The last monarch to occupy the palace was Charles II who stayed at Dunfermline in 1650 just before the Battle of Pitreavie. Anne Halkett described meeting him there. Soon afterwards, during the of Scotland, the building was abandoned and by 1708 it had been unroofed.
The "Queen's House" of 1600 was demolished in 1797. Drawings and engraved views shows battlements and stair towers with conical roofs.
All that remains of the palace today is the kitchen, its cellars, and the impressive south wall with a commanding prospect over the Firth of Forth to the south.