In the race to build America’s first offshore wind farm, the largest contender suffered a significant blow this week after two Massachusetts power companies pulled out of the project. The reversal threatens the broader U.S. effort to bring renewable energy to the ocean, a feat that European nations and China have long since accomplished.

The Cape Wind project planned near Cape Cod would install 130 commercial-scale wind turbines in the Nantucket Sound. The $2.5 billion offshore project has been in the works for 14 years and struggled with a host of financial, regulatory and legal challenges. But the loss of the two utility contracts could be enough to sideline the project for good, experts told the media.

NStar and National Grid said Tuesday they were canceling their contracts to buy about three-fourths of the project’s power output because developers failed to meet major Dec. 31 deadlines. Under the agreements, the project’s developer, Energy Management Inc., was required to complete financing for the project and start construction by the end of 2014.

A National Grid spokesman said the utility was “disappointed that Cape Wind has been unable to meet its commitments under the contract, resulting in today’s termination of the power purchase agreement,” Boston Globe reported Tuesday.

Cape Wind developers say the contract cancellations aren’t valid and have threatened litigation. Jim Gordon, the project’s president, said he had moved to suspend the financing and construction deadlines after a crush of costly lawsuits from project opponents delayed progress, spokesman Mark Rodgers told Commonwealth Magazine.

The offshore wind project would have the capacity to generate more than 360 megawatts of energy, enough to power tens of thousands of homes in Massachusetts. Cape Wind seemed to have hit some luck last summer after the U.S. Department of Energy promised developers a $150 million loan guarantee, an incentive meant to encourage private investment in the project. The pledge was a “conditional commitment,” however, which means the loan guarantee hasn’t yet been issued.

Cape Wind is one of a handful of proposals to bring commercial-scale wind power to U.S. waters. Another major project, Deepwater Wind, experienced its own setbacks in December after it lost a bid for a power purchase contract with the Long Island Power Authority in New York.

Europe, meanwhile, has more than 2,000 commercial wind turbines spinning in the water near 11 countries, with a total power generation capacity of about 6,500 megawatts, according to the European Wind Energy Association. China is on track to install about 2,000 megawatts of offshore wind capacity this year and 10,000 additional megawatts by 2020, the National Energy Administration said last fall.