CORPUS CHRISTI, Tex. — In a twist that would have been unthinkable only two years ago, the oil tanker that arrives in China today may be carrying crude that left the South Texas port of Corpus Christi instead of Saudi Arabia.

Chinese drivers most certainly don’t care where their fuel comes from, but the export of American crude oil to dozens of countries over the last year is the latest chapter in a remarkable turnaround for the American oil and gas industry, about the only good news in three years of plummeting commodity prices, bankruptcies and layoffs.

For 40 years it was virtually impossible to sell American oil to any country except Canada because of an export ban that was a bedrock of United States energy policy. The Obama administration slowly loosened the ban and Congress finally ended it in late 2015 in a compromise that also extended tax credits for renewable energy.