Rooftop solar panel installer Vivint Solar Inc said on Tuesday it had terminated an agreement under which it would have been taken over by solar energy company SunEdison Inc after SunEdison failed to "consummate" the deal.

The cash-and-stock deal, worth $2.2. billion when it was forged last July, had faced criticism from hedge funds and other investors as SunEdison's finances and share price weakened.

SunEdison shares were up 41 percent at $2.68 in pre-market trading, while Vivint's were little changed at $5.20.

Vivint said it intended to "seek all legal remedies available" as a result of the "wilful breach" of the merger agreement by SunEdison.

"We believe both companies will be better off on their own," Cowen and Co analysts wrote in a note to clients, noting that U.S. lawmakers had extended solar investment tax credits beyond 2016, breathing new life into the industry.

The Vivint deal was set to expire on March 18, the analysts said, adding that SunEdison could be liable for an amount "well above" the breakup fee of $34 million following a court hearing or likely settlement.

SunEdison was not immediately available for comment.

Like other solar companies, SunEdison has been hit by the drop in oil prices but it has also faced criticism for trying to grow too quickly through acquisitions that it could not afford.

The company, which has a market value of about $600 million, had long-term debt of $9.77 billion as of Sept. 30. SunEdison said on March 1 that it would delay filing its annual report, citing an internal investigation into its financial position.

As part of the Vivint deal, SunEdison "yieldco" TerraForm Power Inc had agreed to buy Vivint's rooftop solar portfolio for $799 million, revised down from $922 million under pressure from activist hedge fund Appaloosa Management.

Appaloosa Chief Executive David Tepper had called on TerraForm to "resist" the deal, saying it was a departure from TerraForm's business model and would put shareholders at risk.

Appaloosa has also sued SunEdison to try to prevent TerraForm from buying assets from Vivint, which is controlled by Blackstone Group LP.

David Einhorn's Green light Capital said in January it was in talks with SunEdison regarding a board seat and that it was pressing for asset sales or even the sale of the company itself.

Up to Monday's close, SunEdison's stock had lost 94 percent of its value since the Vivint deal was announced, while Vivint's stock had fallen 52 percent.

The cash-and-stock deal, worth $2.2. billion when it was forged last July, had faced criticism from hedge funds