The two largest U.S. rooftop solar companies are merging as the coronavirus pandemic casts a cloud over the market to install panels on homes. Sunrun Inc. RUN 22.63% is acquiring Vivint Solar Inc. VSLR 38.19% in an all-stock deal, the companies said late Monday. The transaction values Vivint at $1.6 billion, excluding debt, according to Sunrun. It comes after a tough few months for the home-solar sector, which analysts say faces diminished growth for years now because of the virus.

The companies told investors Tuesday that the merger will allow them to cut operating costs and leverage complementary sales strategies. The combined company will have nearly 500,000 customers. “It felt like now was a perfect time because we have been through the Covid test,” said Sunrun Chief Executive Lynn Jurich, who will lead the combined firm. “Both companies are emerging stronger from this transition.”

The second quarter was estimated to have been one of the industry’s worst in years as companies grappled with restrictions on making sales in person, as well as delays in permitting and installations. The slowdown is expected to continue as coronavirus cases climb in many sunny states, including Texas, Arizona, California and Florida.

Before the pandemic, energy consulting firm Wood Mackenzie had expected U.S. residential solar companies to add nearly 3,089 megawatts of capacity this year, up nearly 9% from 2019. It has since slashed that forecast to 2,118 megawatts, one-quarter less than last year.

“The timing couldn’t have been worse for the residential segment,” said Wood Mackenzie’s global solar head, Ravi Manghani. “It is basically setting the industry back by two or three years.”

That poses a big challenge for a sector that had only recently regained the momentum it lost after 2016, when Tesla Inc. acquired SolarCity, the market leader at the time. Tesla tried to shift the company’s business online by scrapping door knocking and other means of customer solicitation. Sales fell as a result.