Booming U.S. oil and natural gas production has exerted a “moderating” influence on the trade deficit and set the country on track to become a net oil exporter for the first time in decades, according to new research.

The U.S. merchandise trade deficit in 2017 was almost $250 billion lower than it otherwise would have been if the petroleum (crude oil, refined products and liquids) trade deficit had remained at 2007 levels, according to an IHS Markit report issued Wednesday, “Trading Places: How the Shale Revolution Has Helped Keep the U.S. Trade Deficit in Check.”

The domestic petroleum trade balance also is expected to improve by another $50 billion between 2017 and 2022, researchers said. Continued growth in U.S. production should lead to net petroleum exports for the first time since at least 1949.

“The improved U.S. trade position in petroleum has been a counterbalancing force helping to keep the U.S. trade deficit in check over the past decade,” Vice Chairman Dan Yergin said. “The resurgence of domestic oil and gas production has flipped the trade position of several products along the energy value chain on their heads, while that of other products, such as crude oil, have been significantly reduced.”

U.S. oil and natural gas liquids (NGL) production nearly doubled last year to 13 million b/d from about 7 million b/d in 2007, and it reached 14.8 million b/d through the first nine months of this year. Crude oil output alone rose to 9.4 million b/d in 2017 from 5 million b/d in 2007, and it averaged 10.6 million b/d in the first nine months, hitting 11.2 million b/d in October.

“This rise, combined with a slight decline in domestic demand, contributed to a sharp fall in U.S. petroleum net imports as a share of total consumption, from a high of 60% in 2005 to 19% in 2017 and 14% in nine months of 2018,” researchers said.

The U.S. petroleum trade deficit in dollars fell to an estimated $75 billion in 2017 from about $320 billion in 2007 as imports declined.

“During this same time, when the petroleum trade deficit was shrinking dramatically, the trade deficit for nonpetroleum merchandise grew by about $230 billion,” researchers said.

Continued crude oil and NGL production, combined with relatively flat liquids demand, should make the United States a net petroleum exporter by the early 2020s, marking the first time since the late 1940s that the country will not be a net importer, according to IHS Markit.

“The United States moving from net imports to being a net petroleum exporter would be a historic shift, something not achieved since at least the Truman administration,” Senior Vice President David Witte said. He is division head for energy and chemicals. “It speaks to the profound and continued impact that the U.S. shale boom has had in terms of investment, job creation, manufacturing, gross domestic product and now trade.”

Surging oil and gas production already has altered the domestic net trade position of several energy products and exports should continue to increase across the board, according to researchers.

Regarding U.S. net exports and imports, IHS Markit estimated:

Researchers cautioned that “tensions” between the United States and its trading partners “could introduce new risks, and therefore alter the trajectory of global energy trade and energy demand.”

The U.S. trade war began in May, when the Trump administration imposed a 25% tariff on steel imported from China, as well as a 10% tariff on imported aluminum. The dispute has since escalated. The White House announced tariffs on $200 billion worth of Chinese products in September, and China responded with $60 billion worth of taxes on American goods, including a 10% tariff on liquefied natural gas (LNG).

IHS Markit researchers noted that China is a growth market for U.S. LNG, crude oil, NGLs, as well as gas- and NGL-based chemical exports.

“Overall turmoil in world trade patterns could not only dampen trade along the energy value chain but also affect global economic growth, and thus impact demand for the many hydrocarbon and chemical products that depend on economic growth,” said oil markets director Jeff Meyer.