Broughty Castle dates back to 1495, although it's believed to have been fortified since 1454, given its commanding position over the Firth of Tay.
After varied and colourful "Military Service" the castle fell into ruin and was bought in 1846 by the Edinburgh and Northern Railway company who built the adjacent harbour to support their nearby railway.
Fears of Russian then French attack saw renewed military interest in the 19th Century. The site was retrieved from ruin and houses were built to the north (beside the beach) for the purpose of deploying mines in the estuary against enemy ships. Finally modern gun emplacements were added between 1889 and 1891. Military use ended in 1932 save for a period as a lookout tower during the Second World War 1939-1945.
Today the castle is in the care of Historic Scotland and since 1969 Dundee City Council have operated a small museum in the building telling the history of the town of Broughty Ferry.