The U.S. became a net oil exporter to Mexico for the first time in more than 20 years as output from shale fields pushed the world’s biggest consumer toward energy independence.

Net exports -- comprising only oil products since the U.S. bans most shipments of crude -- totaled 48 Mbpd in July, the U.S. Energy Information Administration said in data released Wednesday. A decade ago, the country bought a net 1.3 MMbbl of oil from its southern neighbor.

The emergence of the U.S. as a net supplier to Mexico underscores how the growth of the shale industry is redrawing the global energy map. Output from shale rocks pushed U.S. oil production to a three-decade high earlier this year, driving down prices, boosting margins for refiners and fueling a debate over whether the country should lift restrictions on exports of crude.

Refineries in the U.S. Midwest earned $24.50/bbl in the third quarter to Sept. 23, compared with $20.80 in the preceding quarter and $17.60 a year earlier, according to BP Plc data.

“The refineries are running so hard that they have extra products and that is getting exported, making the U.S. less dependent on imports overall,” said Gareth Lewis-Davis, senior commodity strategist at BNP Paribas SA in London. “More domestic oil means it’s a boon for the economy and less dependence on Middle East oil.”

Import Sources

The U.S. imports oil from various countries including Saudi Arabia and Iraq. Net oil imports into the U.S. dropped to 4.5 MMbpd in July, 64% less than a decade earlier, according to the EIA. Purchases from OPEC nations sank to 2.6 MMbpd from 6.1 million in July 2005.

A decade ago, Mexico was the fourth-biggest net oil exporter to the U.S. Yet production in the Latin American country has dropped every year since peaking in 2004, BP data show. In a bid to reverse the decline, the government has opened its oil industry to foreign investment for the first time in more than seven decades, awarding oil blocks to companies including Italy’s Eni SpA.

In the U.S., the production of oil and gas from shale rock wasn’t economical until Houston billionaire George P. Mitchell pioneered new extraction techniques in the 1990s. The rock is fractured by injecting high-pressure water, sand and chemicals into a well, releasing the hydrocarbons.

The surge in output over the past decade made the U.S. the world’s biggest natural-gas producer in 2009, prompting moves to convert planned gas-import terminals into export terminals. The first shipment from one such plant, operated by Cheniere Energy Inc., may take place later this year.

The U.S. has prohibited most domestic crude exports for the past 40 years. Producers including Exxon Mobil Corp. and ConocoPhillips have called for an end to the restrictions, and in August the government agreed to allow some light oil to flow to Mexico in exchange for heavier Mexican crude. Congress is scheduled to vote on ending the export ban this month.