Trump at his Scottish golf resort when it was being built in 2011. Photo by Danny Lawson/EPA

Donald Trump hasn't pissed enough people off yet, so he's now decided to massively insult Scotland.

The decision on Wednesday by Britain's Supreme Court to throw out his bid to stop wind farms being built near his luxury golf resort in Scotland "demonstrates the foolish, small minded and parochial mentality" of the Scottish government, said the US presidential contender.

The unanimous ruling by five British judges marks the end of a years-long battle between Trump and UK authorities over plans for an 11-turbine wind farm 1.2 miles off the northeast coast of Scotland.

The government says the $350 million European Offshore Wind Deployment Center will give the Scottish economy a $300 million boost and power 49,000 homes.

Trump says it will ruin the views from the Trump International Golf Links, comprising an 18-hole golf course, hotels, restaurants, and a store slap bang in the middle of one of the world's most "unspoiled and dramatic sea side landscapes."

In 2013 he slammed then-First Minister Alex Salmond as "a man whose obsession with obsolete wind technology will destroy the magnificence and beauty of Scotland."

He stuck the boot into British Prime Minister David Cameron too, accusing him of "playing right into Alex Salmond's hands."

By continuing to give massive subsidies to Scotland's ugly wind turbines, @David_Cameron is playing right into @AlexSalmond's hands. — Donald J. Trump (@realDonaldTrump) January 24, 2013

Nobody wants wind turbines, they are failing all over the world and need massive subsidy--a disaster for taxpayers. — Donald J. Trump (@realDonaldTrump) August 15, 2012

Trump repeatedly called wind power subsidies a "disaster," though, as the Washington Post pointed out, he was quick to change his mind last month when an Iowa voter concerned about how the loss of subsidies might affect her husband's job asked him about them.

Actually, he was okay with wind subsidies, he said, because it could be hard for wind to be competitive. "It's an amazing thing when you think — you know, where they can, out of nowhere, out of the wind, they make energy," he poetically added.

On Wednesday his change in heart reversed quickly back to the thinking people are more familiar with.

"History will judge those involved unfavorably and the outcome demonstrates the foolish, small-minded, and parochial mentality which dominates the current Scottish government's dangerous experiment with wind energy," said a statement from the Trump Organization.

Salmond, now Scotland's Foreign Affairs Minister, said in a statement Trump was "three times a loser" after Wednesday's court verdict, and his "unacceptable behavior" had damaged the economy of Scotland.

Trump, who speaks proudly of being half-Scottish and whose Gaelic-speaking mother hailed from Stornoway on the northern Isle of Lewis, has already lost a series of battles in Britain's lower courts and his last chance to block the plans rested with the Supreme Court, the country's highest judicial body.

"We will evaluate the court's decision and continue to fight this proposal on every possible front," the statement said.

It took nine planning applications and a lengthy public inquiry before Trump defeated neighbors, environmentalists, and online campaigners to win approval for his course in 2010, the first phase of a 750 million pound ($1.13 billion) project.

Back then, he had Scotland's government on his side, overturning objections to grant approval for the project.

But the politicians' support for the wind farms in 2013 has soured the relationship with Trump, and since his controversial campaign comments about Muslims and immigrants, Trump's former friends in Scotland are turning their backs on him.

Last week Aberdeen's Robert Gordon University said it would revoke an honorary degree it awarded Trump in 2010, and Scottish First Minister Nicola Sturgeon stripped him of his role as a business ambassador for Scotland. Cameron's spokeswoman called Trump's comments "divisive, unhelpful, and quite simply wrong".

The Independent on Sunday newspaper reported that the British Open golf tournament organizers had decided that Turnberry, another Scottish course which Trump has bought and is refurbishing at a cost of 200 million pounds, would not host the 2020 championship because of his remarks.

It all comes as more than 555,000 people have signed a petition, set up by a woman from Aberdeen, to ban Trump from entering Britain, the highest number to have backed an online petition on the British parliament's website.

"Most presidents of the US or UK prime ministers usually have about 10 years in office before they go crazy," Salmond, now the SNP's foreign affairs spokesman, told Russia Today on Sunday.

"Donald Trump has made it as a candidate."