The Alliance to Protect Nantucket Sound, the town of Barnstable and the Cape Cod Commission had argued that the Energy Facilities Siting Board had improperly overruled local objections.
But the court said that the law clearly allows the siting board to approve projects whose permits have been denied by local agencies.
The judges said such agencies include the Cape Cod Commission, which had denied the wind farm’s permit.
David Rosenzweig, the attorney for developer Cape Wind Associates, said: "The [court’s] decision brings to a close ten years of state and local permitting for this landmark clean energy project."
Last month the federal aviation administration upheld a "no hazard" ruling it made in May, halting another appeal by the Alliance to Protect Nantucket Sound.
But the project still faces some hurdles. The state Department of Public Utilities (DPU) is reviewing Cape Wind’s power purchase agreement (PPA) with National Grid, for half the wind farm’s power.
State attorney general Martha Coakley recommended that the DPU approve the PPA, but only after she forced a 10% cut in price, from $0.207 to $0.187 per kWh.
The Alliance to Protect Nantucket Sound pledged to keep fighting, calling the court’s decision "an outrageous violation of community rights".