Riding the rising tide of energy prices—and the job growth that goes with it—Texas claims the top spot in CNBC’s 2018 America’s Top States for Business rankings. This is familiar territory for the Lone Star State, which becomes the first four-time winner in our annual study, now in its 12th year. But it has been a long time coming. This is the first time since 2012 that Texas has claimed top honors. Not coincidentally, West Texas Intermediate Crude Oil—the state’s most important export—peaked at just over $108 per barrel that year, a figure it has not seen since. But it has risen enough—around 60 percent in the last year, powering through the $70 per barrel mark in June—to turbocharge the $1.6 trillion Texas economy.

“The Texas economy remains in a broad-based expansion,” said Dallas Federal Reserve economists Christopher Slijk and Jason Saving in a recent report. “The state’s energy sector continues to boom, and areas of the state tied to oil and gas are growing at their strongest pace since 2014.” Texas has added more than 350,000 jobs in the past year, with the largest increase in the energy sector. Put another way, 1 in 7 jobs created in the United States in the past year was created in Texas.

Fans of the Texas Rangers hold a Texas state flag at a game in Arlington, Texas. Stephen Dunn | Getty Images

Workers position a section of pipe during drilling operations at a gas well outside Corpus Christi. Patterson-UTI Energy is drilling the well for Decker Operating of Houston. Eddie Seal | Bloomberg | Getty Images

But Texas is no one-trick pony, notching top 10 finishes not just in Economy but in five of our 10 categories of competitiveness, including Workforce (No. 7), Infrastructure (No. 1), Technology and Innovation (No. 9) and Access to Capital (No. 3). The state finishes with 1,651 out of 2,500 possible points. As always, we rank all 50 states on more than 60 metrics across our 10 categories. Using our tried-and-true , we assign a weight to each category based on how frequently the states cite it in their sales pitches to business. That way, we rate the states based on their own standards. This year’s categories and point totals are: Workforce: 425 points

425 points Infrastructure: 400 points

400 points Cost of Doing Business: 350 points

350 points Economy: 300 points

300 points Quality of Life: 300 points

300 points Technology & Innovation: 225 points

225 points Education: 200

200 Business Friendliness: 150 points

150 points Access to Capital: 100 points

100 points Cost of Living: 50 points

The Texas formula

Since we introduced our rankings in 2007, Texas has never finished outside the top five overall, always following the same basic formula. It started under former Gov. Rick Perry, who is now U.S. Secretary of Energy, and has continued under his fellow Republican successor, Gov. Greg Abbott. The state prides itself on business-friendly regulations, smart spending and low taxes. Texas levies no individual income tax and no corporate tax. Read Gov. Greg Abbott's Top States commentary: Why Texas is the top state for business in America “As far as I’m concerned, the only good tax is a dead tax,” said Abbott in his 2017 State of the State address. The state does not always meet those priorities. This year, for example, it finishes No. 18 for Cost of Doing Business, due in part to property taxes averaging around 1.9 percent — among the highest in the nation — and No. 21 for Business Friendliness because of a sometimes difficult legal climate. Following the formula also means that Texas has some of the same weaknesses it had the last time it finished on top. Texas finishes No. 37 for Education, with some of the lowest high school test scores in the nation. According to the U.S. Census Bureau, only about 82 percent of people over age 25 have a high school diploma — the second-lowest percentage in the nation.

University of Texas campus in Austin Jon Herskovitz | Reuters

And the state finishes No. 31 for Quality of Life. It is not that Texas is necessarily a bad place to live, but the violent-crime rate is high, with nearly 1,500 murders in 2016 — or more than 400 violent crimes per 100,000 residents, according to the FBI. And Texas also has the largest percentage of people without health insurance — nearly 17 percent, according to the Census Bureau. The state also gets poor marks for inclusiveness. It is one of only five states with no public-accommodation law protecting its citizens against discrimination. The Texas legislature, which meets every other year and is next scheduled to convene in January, has shown little wariness about venturing into social territory, despite warnings from business leaders about scaring away top talent.

The Texas economy remains in a broad-based expansion. The state’s energy sector continues to boom, and areas of the state tied to oil and gas are growing at their strongest pace since 2014. Christopher Slijk and Jason Saving Dallas Federal Reserve economists

In 2017 lawmakers considered a so-called “bathroom bill” that would have regulated transgender people’s use of public facilities. The bill died amid staunch opposition from business groups, but backers are promising to reintroduce it next year. Another measure, which critics call the “Show me your papers” law, bans local sanctuary policies on immigration. The law went into effect earlier this year after surviving a federal court challenge. Former Dallas County Sheriff Lupe Valdez, the Democratic nominee to unseat Gov. Abbott in November, said such measures are bad for business in Texas. “This is the Texas brand that’s going out — the bathroom bill, the show-me-your-papers bill. I call them the job-killing bills,” she told CNBC. “We used to be called the friendly state. Let’s get back to who we really are.” Polls show Gov. Abbott with a comfortable lead in his bid for a second term. Also looming on the Texas horizon: potential budget woes. While the state’s finances are pristine on paper, balancing the massive Texas budget creates more accounting challenges every year. Already, the state budget director and the Legislative Budget Board have instructed agency heads to not only hold the line in their funding requests for the next biennium but also submit alternative budgets that include a 10 percent cut. For now, Texas’ many attributes — especially that booming economy — are overshadowing those issues. But if the price of oil declines, hurting a key source of state revenue, or if the United States finds itself in an all-out trade war that curtails imports and exports, Texas’ status as Top State could be vulnerable.

Best of the rest

Rounding out the top five are some perennial contenders and some returning favorites. Washington, , makes a solid run at a first-ever repeat win. The Evergreen State’s economy was the fastest growing in the nation last year, at 4.4 percent, according to the U.S. Commerce Department. But our Economy category also considers other areas where Washington stumbles a bit, like the state’s $13.8 billion in unfunded pension obligations. Factor in recurring weaknesses, such as poor infrastructure and high costs, and Washington is ultimately no match for a resurgent Texas.

The Seattle skyline George Rose | Getty Images

Utah vaults back into the upper echelon at No. 3. Our 2016 Top State had slipped to No. 8 last year. Job growth in the Beehive State, at about 3.4 percent in the past year, actually beats Texas on a percentage basis. Utah’s Silicon Slopes tech region is thriving, with more than 6,500 start-ups and tech companies now based there. Along with that comes growing demand for housing, and that is fueling a construction boom. Utah has added some 50,000 jobs in the past year — a 3.4 percent increase, which is the biggest in the nation. Longtime followers of this study recall that in the early years, Virginia and Texas regularly battled it out for the top spot. But as the Great Recession took hold and the size of the federal government’s presence in Virginia shrunk, the Old Dominion slipped away in our rankings. In 2018 Virginia is back with a solid fourth-place finish. Not only does the state have the educated, available workforce that employers demand, it also has become a leader in business friendliness with the passage earlier this year of a bipartisan regulatory reform bill aimed at reducing regulations by 25 percent in the next three years. Colorado eases back into the top five after last year’s No. 6 finish. The one thing lacking in the Centennial State’s otherwise stellar workforce is enough workers. Unemployment is low, just 2.8 percent, forcing Colorado employers to recruit talent from elsewhere. Job growth in the state remains strong, but the premium wages resulting from the labor shortage are adding to the state’s already high costs.

Biggest movers on the list

This year’s most improved state is New York. While still in the bottom half, at No. 27, the Empire State jumps 11 spots from last year’s No. 38 finish, thanks to solid improvement in its economy. State finances are in good shape, the housing market is strong, and only California is home to more companies. New York is also a leader in incentives and tax breaks for businesses, to the consternation of some watchdog groups. According to government figures compiled by the nonpartisan group Good Jobs First, New York spent more than $4 billion in state and local revenues on business subsidies last year, more than any other state. Not to get carried away, however; the state is still loaded with problems. It is one of America’s most expensive places to live and do business. Taxes, wages, utility costs — even rent for office space — are among the highest in the country. Economic growth is tepid at best. Several high-profile public works projects championed by Gov. Andrew Cuomo are under way, such as the complete rebuilding of New York’s LaGuardia Airport and the new Mario Cuomo Bridge north of New York City. But for now, the state’s infrastructure is among the worst in the nation. Other big improvements include Idaho, rising nine spots to tie with Michigan for No. 11, thanks in part to a boom in manufacturing as the state seeks to position itself as home to what some are calling the Silicon Valley of the food business. Chobani is in the midst of a $20 million expansion at what it says is the world’s largest yogurt plant in Twin Falls. Arizona (No. 20) and Nevada (No. 33) each move up six spots with the help of a surge in construction as the states tackle housing shortages, though both states get failing grades in education. The biggest decline this year belongs to North Dakota, plunging 10 spots to No. 31. Once considered the great American success story — — the shale oil boom that powered the state cooled considerably when the price of oil began falling the following year. Production is rebounding now as prices rise, but not before an exodus of college-educated workers hit the state. Nearly 5 percent of North Dakotans with a bachelor’s degree or higher moved out of state in 2016, according to the Census Bureau, knocking the Peace Garden State down to No. 30 from No. 12 last year in our all-important Workforce category. Other notable declines include Kentucky, which falls seven spots to No. 42. The Bluegrass State is facing a $40 billion pension shortfall, prompting Standard and Poor’s to lower the state’s credit rating in May.

Public school teachers and their supporters protest against a pension reform bill at the Kentucky State Capitol on April 2, 2018, in Frankfort, Kentucky. The teachers are calling for higher wages and demanding that Kentucky Gov. Matt Bevin veto a bill that overhauls their pension plan. Bill Pugliano | Getty Images

In No. 7 Georgia the economy is not the problem — it remains among the strongest in the country. But the Peach State falls five places due to a slight rise in natural gas costs and a rising crime rate.

States with economic woes

We rank all 50 states, so if there are top states, there must also be bottom states. Maine and Rhode Island tie for No. 45 this year. In Maine the issue is its workforce, one of the least productive workforces in the country, based on economic output per job. Rhode Island has been working on its infrastructure, financed by its first-ever tolls on trucks, launched in June. But it still finishes last in the category. At No. 47 is Hawaii. Not only are costs prohibitive in the Aloha State, but it slips to a rare second-place finish in our Quality of Life category (behind Vermont) due to an uptick in crime. No. 48 West Virginia — last year’s bottom state — avoids an embarrassing repeat at No. 50, thanks to a relative rebound in its economy. Coal production has rebounded from depressed levels. West Virginia University researchers say output jumped 24 percent in the first half of last year, from 75 million short tons to 93 million. But the same report warns that growth is likely to level off soon.

A homeless man in Biloxi, Mississippi. According to the latest US Census Bureau data, Mississippi is the nation's poorest state, with a median income of $41,754. The city of Biloxi has struggled to make progress after the devastating flooding from Hurricane Katrina in 2005. Getty Images