RSPB Scotland opposed the developments in the Firth of Forth and Firth of Tay over concerns for wildlife.
Scottish ministers approved the Inch Cape, Neart na Gaoithe and Seagreen Alpha and Bravo projects in 2014.
The projects could provide power for 1.4 million homes.
RSPB Scotland lawyers argued that the Scottish ministers were in breach of the requirements placed upon them by the law when they made their original decisions.
The lawyers argued that the ministers didn't give proper consideration to the area being a haven for rare wildlife.
Judge Lord Stewart ruled in favour of RSPB Scotland at the Court of Session in Edinburgh.
He ordered that the Scottish ministers will have to reconsider the decisions on whether to grant planning permissions for the developments.
Their new decision will have to address the legal points brought out in court by the RSPB Scotland team.
In a statement, RSPB Scotland said that the legal challenge was a "last resort decision" which it had made "with great reluctance."
It said: "Unfortunately, consents were granted when thousands of gannets, puffins, kittiwakes and other seabirds from iconic internationally-protected wildlife sites like the Bass Rock and the Isle of May were predicted to be killed every year.
"The government's statutory nature conservation advisors, Scottish Natural Heritage and the Joint Nature Conservation Committee, had also raised significant concerns about the wind farms.
"In these circumstances, RSPB Scotland could not just stand by and let such devastating impacts on Scotland's wildlife happen without making a stand."
Lloyd Austin, the society's head of conservation policy, said: "RSPB Scotland is now keen to work with all parties to ensure we focus efforts on delivering much-needed renewable energy in a way that does not threaten Scotland's internationally-important wildlife."
Minister for business, innovation and energy Paul Wheelhouse said: "Scottish ministers note Lord Stewart's judgement and will now carefully consider it and its implications.
"The Scottish government remains strongly committed to the development of offshore wind energy, as this key low-carbon technology offers a huge economic opportunity for Scotland, but, crucially, through helping to decarbonise our electricity supply, it also has a key role to play in our fight against the threat posed by climate change to both our society and our natural environment.
"Clearly, protecting Scotland's marine environment is of paramount importance: it is at the heart of the Scottish government's approach to offshore renewable energy applications, and we are keen to work constructively with both the RSPB and renewable energy developers to ensure the sector has a bright future in Scotland."

Just days after dropping a supreme court action, the twins filed a fresh lawsuit against the company.
It claims that Facebook "intentionally or inadvertently suppressed evidence" during their previous litigation.
Originally, Tyler and Cameron accused Mr Zuckerberg of stealing their idea to create the site.
The story of the feud formed the core of the 2010 film "The Social Network".
The row dates from 2003 when the Winklevosses hired Mr Zuckerberg to write code for their ConnectU site while at Harvard.
He never did, but instead set up Facebook, which quickly became a success around the world.
A court case over who did what was resolved in 2008 when the parties agreed on a financial settlement, reportedly worth around $65m (Â£41m).
In January 2011 the Winklevosses tried to reopen the case, seeking more money. However, a US appeals court ruled in April that they would have to accept the settlement.
The twins initially said they would appeal against the settlement, but decided this week not to pursue that legal avenue.
In the most recent suit filed on Thursday with the US District Court of Massachusetts, the Winklevosses and their business partner Divya Narendra said that Facebook hid some crucial information from them during settlement proceedings.
The twins said that Mr Zuckerberg did not disclose some important documents in regards to the relationship between him and the brothers while they were at Harvard.
Facebook's outside counsel Neel Chatterjee said in a statement: "These are old and baseless allegations that have been considered and rejected previously by the courts."
Conservationists have won a legal challenge in Scotland's highest court against four major offshore wind farm projects.
[NEXT_CONCEPT]
The Winklevoss brothers have re-started their long-running legal dispute with Facebook and its boss Mark Zuckerberg.