Lawyers for the businessman went to court to oppose the 11-turbine European Offshore Wind Deployment Centre (EOWDC) off the Aberdeenshire coast, claiming it would spoil the view from his luxury development at Menie Estate, near Balmedie. He had earlier threatened to pull the plug on the resort if the wind farm goes ahead.
The petition lodged by Trump International Golf Club Scotland and the Trump Organisation had asked the Court Of Session in Edinburgh to rule that the Scottish Government's approval of the wind farm was unlawful and should be overturned. However, judge Lord Doherty dismissed the petition.
The Trump Organisation, which announced yesterday it had bought Doonbeg Golf Club in County Clare, insisted the turbine development was doomed, despite the court ruling. Mr Trump said: "We will appeal this decision and in the meantime we will be focusing all of our investment and energy towards our new acquisition on the Atlantic Ocean in Ireland."
In a statement, the Trump Organisation added: "Today's decision has not altered our unwavering commitment to protect our investment in Scotland. The EOWDC proposal has numerous economic and legal obstacles that will ultimately prevent its construction."
The offshore project was put together by Vattenfall Wind Power and Aberdeen Renewable Energy Group. Over one year the turbines will be capable of yielding, on average, enough electricity to power 68,000 UK households, according to the group behind the project.
Lawyers for Mr Trump sought judicial review of the Scottish Government's decision not to hold a public inquiry in relation to the wind farm application and of its decision to approve the project.
But the judge, who is issuing his findings in a written decision, said he was satisfied Energy Minister Fergus Ewing "was entitled to grant consent subject to the conditions which he imposed".
EOWDC spokesman Iain Todd said: "The EOWDC is widely accepted as a much-needed centre of significant European importance with a pivotal role to play in helping the Scottish and UK Governments meet their ambitious renewable energy targets."
WWF Scotland director Lang Banks described the judgment as "great news". He said: "It is good to know that despite all his bluster, the courts saw right through Trump's flimsy, misguided attempts to frustrate Scotland's ambition to create clean power and green jobs."
A Scottish Government spokeswoman said: "The proposed European Offshore Wind Deployment Centre is an important project for Aberdeen and north east Scotland. It will give the industry the ability to test and demonstrate new technologies to accelerate its growth."