EDINBURGH: Historic Environment Scotland (HES) said more people were visiting after Scotland was used as a location in films such as Mary Queen of Scots.
Fans of the TV shows Outlander and Outlaw King also boosted numbers.
Doune Castle near Stirling – which featured as Castle Leoch in Outlander – saw a 14% increase in footfall after 142,091 people visited last year.
Urquhart Castle by Loch Ness had more than half a million visitors for the first time, up 6% to 518,195.
Stirling Castle saw an increase of 7% to 605,241 visitors – making it the second most visited HES-staffed heritage site in 2018.
As in previous years, Edinburgh Castle came out top with 2,111,578 visitors, an increase of 2%.
Urquhart Castle had more than half a million visitors for the first time
Blackness Castle in West Lothian reached 50,000 visitors for the first time – an increase of 36% from the previous year.
Overall footfall to HES-staffed sites grew by 5% from 2017 to 5,229,049.
Stephen Duncan, HES commercial and tourism director, said: “As well as the Outlander effect bringing international visitors to Scotland to explore its rich history, we have also seen an increase in the number of Scots visiting heritage sites as evidenced in our highest ever membership figure.
“With Scotland being used as a filming location for productions such as Outlaw King and Mary Queen of Scots, we hope visitors will continue to be inspired to explore the history of the sites they see on the big screen.”
HES looks after 300 heritage sites, including 77 staffed Historic Scotland attractions.
Glasgow Cathedral and Skara Brae were among its top 10 visited sites last year, along with Linlithgow Palace, St Andrews Castle, Fort George and Iona Abbey.