Nicola Sturgeon congratulates Donald Trump on presidential victory
Scotland's first minister has congratulated Donald Trump on his surprise election win despite admitting it was "not the outcome I wanted".
Nicola Sturgeon publicly backed Hillary Clinton ahead of the presidential vote.
But she said the result of the election should be respected, and that Scotland valued its relationship with the US.
Ms Sturgeon removed Mr Trump from a list of Scottish business ambassadors when he suggested Muslims would be stopped from entering the US.
Her predecessor as first minister, Alex Salmond, has previously backed calls for Mr Trump to be banned from the UK.
- President Trump's relationship with Scotland
- Live coverage as Donald Trump wins the presidency
- Trump beats Clinton to take White House
- An astonishing new chapter in US history
Mr Trump is to become the 45th US president after a stunning victory over Mrs Clinton, the Democrat candidate.
The Republican nominee's victory came down to a handful of key swing states, despite months of polling that favoured Mrs Clinton.
As he addressed supporters at a victory rally in New York, Mr Trump said it was "time for us to come together as one united people".
Donald Trump's Scottish roots
President-elect Trump's mother, Mary MacLeod, was born in the village of Tong on Lewis in the Western Isles in 1912.
She left the island at the age of 18 for a holiday in New York, where she met and later married local builder Fred Trump.
Their son Donald spoke of his late mother's Scottish heritage in 2006 when he bought the Menie Estate in Balmedie, Aberdeenshire, turning it into a golf resort against the wishes of local residents.
In April 2014, the 70-year-old US tycoon also purchased the Turnberry hotel and golf resort in Ayrshire.
Mr Trump also unsuccessfully challenged Scottish government ministers in court over their decision to approve an offshore wind farm near his Aberdeenshire golf course.
Responding to the result, Ms Sturgeon said: "While this is not the outcome I hoped for, it is the verdict of the American people and we must respect it. I congratulate President-Elect Trump on winning the election.
"We value our relationship with the United States and its people. The ties that bind Scotland and the US - of family, culture and business - are deep and longstanding and they will always endure."
Ms Sturgeon said the result had left many people in the US and across the world with a "real sense of anxiety".
She added: "I hope the president-elect will take the opportunity to reach out to those who felt marginalized by his campaign and make clear - in deeds as well as words - that he will be a president for everyone in modern, multicultural America.
"Today must also be a moment for those who share progressive values - all of us who believe in tolerance and diversity - to speak up loudly and clearly for the values we hold dear."
The first minister also paid tribute to Mrs Clinton, saying her candidacy had represented a "major step forward for women in America and across the world".
Ms Sturgeon told BBC Scotland she did not regret backing Mrs Clinton during the election, calling some of Mr Trump's comments during the campaign "undoubtedly racist".
She added: "The comments made during the campaign were deeply offensive to many different groups in society and there's a need now and a big responsibility on his shoulders to bring people together.
"I'm never going to shy away from my believe in articulating principles of tolerance and respect and diversity and multiculturalism.
"The relationship between Scotland and America is an important one, and I'm not going to, because of my own personal views, risk the interests of Scotland by not engaging with the American government. But the nature of that engagement will depend to some extent on how Donald Trump conducts himself as President."
UK Prime Minister Theresa May has also congratulated Mr Trump on his election as US president, and said Britain and America would remain "strong and close partners".
But several Scottish political figures have expressed their shock and disappointment over Mr Trump's victory.
Mr Salmond, who is now the SNP's foreign affairs spokesman at Westminster, said his own disappointment at the result was "as of nothing" compared to the people, religions and racial minorities who had been "demeaned and insulted by Donald Trump" during the campaign.
The former first minister added: "The difficulty with Donald Trump is not when he's winning, it's not when he's getting his own way, he's nice as ninepence when he's getting his own way.
"It's what happens when he reaches road blocks, obstacles, when somebody says no to him. In these circumstances we'd better all just hope that the presidency changes a man."
Scottish Conservative leader Ruth Davidson said it was not the result she wanted, and expressed her hope that "President Trump turns out to be a different man to candidate Trump".
Her Scottish Labour counterpart, Kezia Dugdale, said it was a "dark day" and accused Mr Trump of running a "hate-filled campaign that was dominated by lies, misogyny and racism".
Scottish Greens co-convenor Patrick Harvie called on the Scottish government to shun Mr Trump, who Mr Harvie described as a "racist, sexist bully".
And Scottish Liberal Democrat leader Willie Rennie said the UK should use its "special relationship" with the US to "stand up for the different minorities in his country who will wake up today more fearful than they have for decades".
However, UKIP's Scottish leader, David Coburn, predicted Mr Trump would be "good for Scotland" because of his strong connections to the country.
The endorsements of Mrs Clinton by Scottish politicians could backfire once Mr Trump formally become president, according to Fiona Hill, an analyst at the Brookings think tank in Washington.
She said: "It might actually matter because Donald Trump does take things quite personally.
"He's made it quite clear that when he has a rift on a personal and business level that he's quite serious about responding."
But the former US assistant Secretary of State, Kurt Volker, doubted that these past concerns would feature prominently in the new president's thinking.
He said the focus would instead be on global issues including Russia, the economy, Islamic State and forging a new relationship with the UK after Brexit.
More than 1,000 students from the University of Edinburgh packed into the city centre to watch the battle for the White House unfold at an event dubbed by organisers as "the largest US election night party in the UK outside of London".
Organised by Edinburgh University North American Society and the Edinburgh Political Union, the sold-out event in Potterrow saw TV screens beaming results live from across the Atlantic with experts from the school of history providing live analysis on the results throughout the night.
The US Consulate General also held an event on Tuesday night at Edinburgh University with hundreds of North American ex-pats attending to watch the results come in.
At Donald Trump's Aberdeenshire golf course, Sarah Malone, executive vice president of Trump International, said it was a "truly historic day" and he would serve with "unwavering passion and commitment".
However, Menie resident Susan Munro, who fought Trump over his golf development, said her reaction to the win was "shock horror".
She added: "He would not have been my choice anyway. It will be interesting".