The energy sector was taking a broad beating in afternoon trading Tuesday, to pace the S&P 500 /zigman2/quotes/210599714/realtime SPX +0.82% sector decliners, even as crude oil and natural gas futures gained ground. The SPDR Energy Select Sector ETF /zigman2/quotes/206420077/composite XLE +1.71% slumped 1.8% with 22 of 23 equity components losing ground, led by the 4.2% drop in APA Corp.'s stock /zigman2/quotes/200648444/composite APA +2.74% , the 3.7% selloff in shares of Baker Hughes Co. /zigman2/quotes/205323712/composite BKR +2.16% and the 2.6% decline in Occidental Petroleum Corp. /zigman2/quotes/207018272/composite OXY +2.48% shares. Of the most active components, shares of Exxon Mobil Corp. /zigman2/quotes/204455864/composite XOM +1.08% slid 2.4% and Marathon Oil Corp. /zigman2/quotes/205031829/composite MRO +2.21% gave up 2.0%. The sector tracker's lone non-loser was Devon Energy Corp.'s stock /zigman2/quotes/209479244/composite DVN +2.82% , which was little changed. The energy ETF has now lost 5.5% since closing a 15-month high on May 17. Meanwhile, crude oil futures /zigman2/quotes/209723049/delayed CL00 -0.24% gained 0.1% and natural gas futures /zigman2/quotes/210189548/delayed NG00 +0.89% rose 0.9%, while the S&P 500 /zigman2/quotes/210599714/realtime SPX +0.82% slipped 0.2%.