"Scotland’s most expensive home" has changed hands during an extraordinary period in the country’s top-end market, Savills said.

The agent said the “highest price ever paid for a residential property in Scotland”, which was a historic castle for sale at offers over £8 million, bolstered a record year in the £1m-plus bracket north of the Border in 2022, the agent said.

The sale of Seton Castle in East Lothian, a "13 bedroom mansion built with the remnants of a palace used by Mary Queen of Scots", led the 491 residential transactions at £1m and above, Savills added.

With a "rebalancing towards urban locations", Scotland’s largest cities dominated 2022, led by Edinburgh, which had a record 287 transactions.

The majority of second-hand sales took place in the inner suburbs of Grange, Morningside and Merchiston, attracting buyers seeking large family homes.

READ MORE: Family sells historic Scottish hotel on market at £2.5 million

With five transactions each, Craiglea Drive and Nile Grove were among the most active thoroughfares.

Following a slight dip in 2021, Edinburgh’s New Town, led by Great King Street, made a "roaring comeback" with multiple sales, reflecting the desire to be close to local services in 20-minute neighbourhoods.

Glasgow City saw a record 31 transactions last year above £1 million, led by the West End, with the Park Area also seeing robust performance.

Glasgow’s suburban market remained level last year, including in areas with sought-after schooling, such as Bearsden and Giffnock, and also in hamlets such as Bothwell and Thorntonhall in Lanarkshire.

READ MORE: Hotel plan for famous Scottish pub 

Scotland’s smaller towns and villages remain popular among aspiring buyers seeking a lifestyle change and more space, underpinned by flexible working patterns.

Leading million-pound locations around Edinburgh included Gullane, North Berwick and Longniddry in East Lothian and Linlithgow in West Lothian.

St Andrews saw a record 16 transactions above £1 million, including new build sales at Hamilton Grand, and family homes, with Hepburn Gardens among the leading thoroughfares.

READ MORE: Family to sell hotel and wedding venue for £1.35 million

Elsewhere, villages surrounding Perth and also Killearn in Stirlingshire and along Ayrshire’s west coast saw a steady top-end market, said Savills.

Whilst million-pound activity in Scotland’s rural areas did not witness the elevated levels seen in 2021, country house sales in Highland and Argyll saw record numbers.

Whereas recorded sales above £1 million across the North East were limited, "Aberdeen’s sought-after AB15 postcode and Kincardineshire to the south witnessed the most transactions at that level".

Faisal Choudhry, Savills Head Residential Research in Scotland, said:  “Looking ahead, despite increased price sensitivity, sales activity in 2023 so far has been above pre-pandemic levels and going forward will remain underpinned by the value gap, quality of life on offer and the ongoing shortage of well-presented homes in the most sought-after locations.”