The three biggest clean energy exchange-traded funds in the U.S. based on assets surged as the landmark tax, climate and health-care bill made its way to Congress.

The iShares Global Clean Energy ETF (ticker ICLN), the First Trust Nasdaq Clean Edge Green Energy Index Fund (QCLN) and the Invesco Solar ETF (TAN) rose by roughly 14%, 16% and 17%, respectively, from July 25 to Aug. 8. The rally started toward the end of July when Sen. Joe Manchin announced his support of the legislation and it picked back up on Monday after the Senate passed the bill, which includes roughly $374 billion in climate and energy spending.

"They've accelerated in performance and in some cases started to outperform the S&P 500 Index. I think that's where this deal comes into play — there's some sort of catalyst at least to get renewables out of this really difficult environment that they've been in," Todd Sohn, an ETF strategist at Strategas Securities, said last week.

The three funds outperformed the S&P 500 by almost 10 percentage points over the last two weeks, and have bested the index in the previous three months.

To be sure, clean energy stocks have been volatile over the last two years, as some researchers strongly tie their performance to government policy fluctuations.

Among the stocks that benefited most from the bill's passage are Enphase Energy Inc., a top holding of all three ETFs, rose over 30% and Plug Power Inc., also a holding of ICLN and QCLN, skyrocketed by over 46% in the last two weeks. Green stocks both in the U.S. and internationally are expected to move as a result of the deal's potential tax credits and subsidies.

"This political tailwind should continue to act as a positive catalyst for these names in the near-term," Jessica Rabe, co-founder of DataTrek Research, said last week after Manchin's approval of the deal. "However, Republicans are expected to take back control of Congress this fall, so it's important to remember that policy uncertainty contributes to their volatility and that's unlikely to change over the next few years."

The clean energy ETFs still have a long way to go to reach last year's high in early 2021, which took place as Joe Biden was inaugurated president and the Democratic Party took control of Congress, signifying potentially larger investments in clean energy.

Although the ETFs saw a combined $320 million of net inflows over the last two weeks, flows have lagged in the past few months, with investors withdrawing more than $420 million among the three funds so far this year as higher interest rates dulled the shine of many growth stocks that make up ICLN, TAN and QCLN.

"They've kind of been left out of the picture," Sohn said. "There's plenty of room to get more aggressive in terms of inflows going forward."

Enrique Roces reports for Bloomberg News.

Copyright 2022 Bloomberg. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.