Linlithgow Palace had record single-day visitor numbers for its jousting event.

More than 7,000 people descended on the palace and Linlithgow Peel on Saturday 5 July.

World-class

Culture Secretary Fiona Hyslop said: "This has been an incredible summer for Scotland so far, and in the year that Scotland welcomes the world, I am delighted that Edinburgh Castle, along with a number of our most iconic historic attractions, is enjoying record-breaking visitor numbers.

"The income generated by these visits is invested back into the historic environment, ensuring that it is cared for and maintained for future generations."

Stephen Duncan, director of commercial and tourism at Historic Scotland said: "Edinburgh Castle enjoyed a record-breaking July in 2013, so it's hugely encouraging to see those impressive visitor numbers being surpassed this year.

"In the Year of Homecoming 2014 and during a summer when the eyes of the world are on the international events taking place in Scotland, it is wonderful to see that pattern reflected across a number of sites in our estate.

"As the biggest operator of visitor attractions in Scotland, we continue to invest in our visitor experience, from retail and membership products to our award-winning events programme.

"I am delighted that record numbers of visitors from around the globe are coming to our sites to enjoy the world-class experience we have to offer."