Engineers are battling to restore power to hundreds of homes in time for Christmas Day after winds gusting up to 77 mph swept across Scotland.

At the peak of the storm 3,500 houses in the north of the country were cut off from the electricity supply with 822 still without power.

The worst affected areas were Deeside and Buchan in Aberdeenshire and Fort William and Wick in the Highlands, Scottish Hydro Electric Power Distribution said.

Around 400 of its staff are working to reconnect the remaining properties.

"They will continue to work into the evening and we expect, weather permitting, to restore power to these homes this evening," a spokesman said.

The high winds caused disruption for many people making their way home for Christmas.

The Northern and Western Isles were the worst affected areas with those attempting to reach destinations such as South Uist, Harris and Lewis thwarted by cancelled ferries and flights.

More than 20 flood warnings remain in place across the mainland with high tide being accompanied by heavy rainfall.

The majority of the warnings cover Tayside where river levels are expected to be particularly high.

The Met Office earlier issued amber ''be prepared'' warnings for 80-90mph winds in Argyll and Bute, the Highlands and the islands.

At the height of the storm this morning a gust of 77 mph was recorded at Inverbervie in Aberdeenshire while winds of 75 mph hit South Uist, MeteoGroup said.

The rest of the country was buffeted by speeds of between 50-60 mph, causing Christmas attractions in Edinburgh to temporarily close.

Police Scotland said a portion of the roof at Thurso High School, in Thurso, Caithness, was blown off by high winds at about 2.15pm.

A large piece of the felt roof became caught in a tree in the town's Ormlie Road, damaging two vehicles and closing the road.

Fallen trees and debris caused problems on some roads in the Borders with a mud slide temporarily closing the A7.

The Skye, Forth, Tay and Dornoch bridges remain closed to high-sided vehicles.

Numerous CalMac ferry sailings were cancelled and P&O sailings between Larne in Northern Ireland and Cairnryan in Dumfries and Galloway were suspended.

In what could be a first for Christmas Day, CalMac said it would attempt to put on special sailings from Skye to North Uist and Harris tomorrow.

A handful of flights from Glasgow Airport to Tiree, Campbeltown and Barra were cancelled, as were flights between Aberdeen and Sumburgh, Stornoway and Kirkwall.

Yellow "be aware" warnings of wind remain in place for most of the country tonight and will stretch into Christmas Day in the Highlands and Islands, Orkney and Shetland.

A snow alert is also in force in the Highlands and Islands, Moray, Aberdeenshire, Argyll and Bute, Perth and Kinross and Stirling.

Tom Tobler, a forecaster with MeteoGroup, said: ''It's going to stay windy throughout the day and overnight as well, dying down for Christmas Day but it will remain breezy in the north west with winds of around 60mph.

''There's a large area of low pressure sitting just off the west coast and it is moving slowly, leading to the stormy conditions.

''Showers will accompany the winds but should pass during the day, falling as sleet and snow on higher ground.

'It looks like only those in the highest parts, about 200-300m above sea level, will see any kind of white Christmas, with little snow expected in lower lying areas.''

Transport Minister Keith Brown earlier held a meeting of the Government's resilience committee with First Minister Alex Salmond and transport operating companies.

He said: ''Scotland is currently experiencing a significant winter storm, however, these are not unusual conditions for this time of year and I urge people to follow advice and take sensible precautions.

''We are already working closely with all our partners to share information and keep Scotland moving to ensure Scots can get home to their families and loved ones for Christmas."