The Dallas-Fort Worth region is home to 22 companies on this year's Fortune 500 list, as local energy businesses gained ground in the annual ranking of the nation's largest publicly traded firms by revenue.

Irving-based oil titan Exxon Mobil — one of just three companies to have held the list's vaunted No. 1 spot — climbed to second place after slipping to fourth amid falling oil prices last year. The company pulled in $244.4 billion in 2017, a roughly 17 percent increase from the previous year.

Retailer Walmart took the No. 1 spot for the sixth consecutive year, clearing the $500 billion revenue mark for the first time in company history.

Dallas' AT&T held steady at No. 9, the only other Texas company in the top ten. Texas as a whole ranks third nationally in Fortune 500 companies, just behind California, which plays host to 49 such firms. New York held onto its No. 1 spot, with 58 corporations in the list.

The Houston area had 21 Fortune 500 companies, almost all in energy, while San Antonio had four. Austin had one entry — Dell Technologies, based in Round Rock.

Both Fort Worth-based American Airlines, at No. 71, and Dallas-based Southwest Airlines, at No. 142, lost four spots in the shadow of climbing fuel prices, though revenues are increasing.

Texas oil companies saw a big boost in the rankings almost across the board. Energy Transfer Equity, based in Dallas, rode its $47.5 billion in revenue to No. 64, a 15-spot gain from last year's list.

Oil prices have climbed over the past year, one possible explanation for the health of Texas energy companies. Oil cost less than $50 a barrel this time last year — now it sits at more than $70.

But it may be too early to quantify the impact of recent economic changes, said Bernard Weinstein, the associate director of the Maguire Energy Institute at Southern Methodist University.

"I don't think oil prices would be reflected quite yet," he said. It's more likely that improvements at companies like Exxon come from increased profitability in their oil refining and petrochemical operations, he said.

Celanese, the Irving-based chemicals company that in 2015 opened one of the country's largest methanol plants in Clear Lake, Texas, lept 29 spots and broke into the list as No. 455.

Texas produced other newcomers to the ranking, such as Houston's Cheniere Energy, a producer of natural gas, at No. 489. Irving-based Pioneer Natural Resources jumped 109 spots from outside the Fortune 500 to No. 497, one of many gas companies to fire on all cylinders in light of the cheap abundance of U.S. natural gas.

The future isn't as bright for legacy Plano-based department store chain J.C. Penney, which has struggled during tough times for brick-and-mortar retail. The company dropped 14 spots, to 235, in this year's ranking.

The retailer is the exception, however, as most Texas companies in the rankings did well, especially those clustered around Dallas and Houston. On average, Texas firms moved at least 20 spots up.

Here are the D-FW companies that made the list and their ranks:

2. ExxonMobil

9. AT&T

64. Energy Transfer Equity

71. American Airlines Group

142. Southwest Airlines

147. Tenet Healthcare

153. Fluor

163. Kimberly-Clark

192. Texas Instruments

206. Holly Frontier

211. D.R. Horton

235. J.C. Penney

297. Jacobs EngineeringGroup

322. Game Stop

362. Dean Foods

365. Alliance Data Systems

397. Yum China Holdings

400. Builders First Source

418. Dr. PepperSnappleGroup

455. Celanese

497. PioneerNaturalResources

499. Vistra Energy