As July comes to an end, it's time to take a look at the best- and worst-performing industry ETFs for the month.

Among the largest ETFs that represent major U.S. stock indices, the SPDR S&P 500 ETF Trust (SPY  ) returned 3.1% in July, marking its fifth consecutive month of gains. The SPDR Dow Jones Industrial Average ETF (DIA  ) had similar monthly performance, but the Invesco QQQ Trust (QQQ  ) outperformed by 3.8%. The strongest performer, though, was the iShares Russell 2000 ETF (IWM  ), which increased by 4.9%.

Which industries have performed significantly better than the overall market? Which ones, on the other hand, had a particularly rough month despite the broader risk-on period?

5 Top Performing Industry ETFs In July

5) Semiconductors - VanEck Semiconductors ETF (SMH  )

- Total return month-to-date: 5%

- Total return year-to-date: 58.8%

- Top holdings: NVIDIA Corp. (NVDA  ) (20%), Taiwan Semiconductor Manufacturing Company (TSM  ) (10.74%), Broadcom Inc. (5.64%) (AVGO  )

- Monthly stock contributors: Nvidia (2.8 percentage points), Lam Research Corp. (LRCX  ) (0.6pp), Intel Corp (INTC  ) (0.5pp)

4) Agriculture - VanEck Agribusiness ETF (MOO  )

- Total return month-to-date: 7.8%

- Total return year-to-date: 3.1%

- Top holdings: Zoetis Inc. ZTS (8.6%), Deere & Company DE (8.33%)

- Monthly stock contributors: Zoetis Inc. (1pp); Archer-Daniels-Midland Company ADM (0.9pp);

3) Oil & Gas - SPDR Oil & Gas Explor. & Prod. ETF (XOP  )

- Total return month-to-date: 10.1%

- Total return year-to-date: 11%

- Top holdings: Antero Resources Corp. (AR  ) (2.6%), SM Energy Company (SM  ) (2.5%)

- Monthly stock contributors: Ovintiv Inc. (OVV  ) (0.6pp); APA Corp. (APA  ) (0.5pp)

2) Oil services - VanEck Oil Services (OIH  )

- Total return month-to-date: 18.9%

- Total return year-to-date: 18.4%

- Top holdings: Schlumberger Ltd. (SLB  ) (19.6%); Halliburton Company (HAL  ) (11%).

- Monthly stock contributors: Schlumberger Ltd. (4pp); Halliburton Company (2.2pp)

1) Regional Banks - SPDR S&P Regional Banking ETF (KRE  )

- Total return month-to-date: 19.8%

- Total return year-to-date: -16.2%

- Top holdings: Western Alliance Bancorp. (WAL  ) (2.4%), Pinnacle Financial Partners, Inc. (PNFP  ) (2.3%).

- Monthly stock contributors: Western Alliance Bancorp. (0.85pp); ZIONS Bancorporation (ZION  ) (0.8pp)

5 Worst Performing Industry ETFs In July

5) Water Resources - Invesco Water Resources ETF (PHO  )

- Total return month-to-date: 2.9%

- Total return year-to-date: 12.6%

- Top holdings: Danaher Corp. (DHR  ) (8.1%), Ecolab Inc. (ECL  ) (8%), Ferguson Plc

(FERG  ) (8%).

- Monthly stock draggers: Valmont Industries Inc. (VMI  ) (-0.3pp); Mueller Industries Inc. (MLI  ) (-0.1pp).

4) Biotech - iShares Biotechnology ETF (IBB  )

- Total return month-to-date: 2.1%

- Total return year-to-date: down by 0.3%

- Top holdings: Amgen Inc. (AMGN  ) (8.5%), Vertex Pharmaceuticals Inc. (VRTX  ) (8.5%)

- Monthly stock draggers: Apellis Pharmaceuticals (APLS  ) (-0.7pp); Biogen Inc. (BIIB  ) (-0.3pp).

3) Real Estate - Vanguard Real Estate ETF (VNQ  )

- Total return month-to-date: 2%

- Total return year-to-date: 3.3%

- Top holdings: Prologis Inc. (PLD  ) (7.6%), American Tower Corp. (AMT  ) (6%).

- Monthly stock draggers: CoStar Group Inc. (CSGP  ) (-0.2pp), Crown Castle Inc. (CCI  ) (-0.2pp)

2) Airlines - U.S. Global Jets ETF (JETS  )

- Total return month-to-date: down by 0.4%

- Total return year-to-date: 25.9%

- Top holdings: Delta Airlines Inc. (DAL  ) (10.8%), American Airlines Group Inc. (AAL  ) (9.8%).

- Monthly stock draggers: American Airlines Group Inc. (-0.5pp), Southwest Airlines Co. (LUV  ) (-0.4pp)

1) Solar - Invesco Solar ETF (TAN  )

- Total return month-to-date: down by 3.3%

- Total return year-to-date: down by 4.4%

- Top holdings: First Solar Inc. (FSLR  ) (11.1%), Enphase Energy Inc. (ENPH  ) (9.1%)

- Monthly stock draggers: SolarEdge Technologies Inc. (SEDG  ) (-0.7pp), SMA Solar Technology AG (SMTGF  ) (-0.6pp).