President Donald Trump delivers remarks during an 'Unleashing American Energy' event at the Department of Energy in Washington, U.S., June 29, 2017.

The United States has been sprinting toward energy independence over the last decade, but that progress has come to a halt under President Donald Trump, according to new research from Goldman Sachs.

The Trump administration is pushing a policy of "energy dominance," rolling back regulations and actively pushing sales of the nation's growing oil and gas supplies to all corners of the globe. But Goldman's head of energy research is highlighting a surprising trend in light of that policy.

The precipitous drop in the nation's dependence on foreign energy commodities during the Obama administration slowed last year and is set to flatline in 2018.

U.S. net energy imports have plunged 95 percent from their peak in 2008 through the end of last year, hitting levels not seen since the 1970s, Goldman's Damien Courvalin notes in research released Wednesday. However, higher oil prices have created a speed bump to achieving energy independence, and the trade war Trump is pursuing against China threatens to further delay the long-sought goal, he says.

According to Courvalin, the rapid progress toward energy independence is mostly due to surging U.S. natural gas shipments and a boom in oil sales after Congress and President Barack Obama lifted a 40-year ban on exporting crude. OPEC's deal with Russia and other producers to boost oil prices by cutting output has also helped to shrink the U.S. trade deficit in energy products.

But oil prices hit 3½-year highs above $80 a barrel this year after Trump sanctioned Iran and as OPEC members cut output more deeply than intended. That rise in crude prices is the primary reason the U.S. energy trade deficit is no longer shrinking, Courvalin says.

Goldman expects the United States to start closing the deficit again in the second half of next year as oil and natural gas exports pick up and crude prices stabilize around $65 a barrel. It forecasts the United States will be energy independent by 2019 and oil independent in 2021.

That does not mean the United States will no longer buy foreign oil or energy commodities. It means the United States well sell more oil and energy products overseas than it imports.

Goldman sees U.S. oil and gas output from shale fields getting a boost from a favorable regulatory environment under Trump. However, the White House's trade war with China could affect the bank's outlook for energy trade, especially as Beijing begins to target U.S. exports of oil, natural gas and other petroleum products, Courvalin says.

"Even before their implementation, these proposed tariffs are starting to have an impact, with Chinese imports of US crude falling by 70% from April to July," Courvalin writes.

However, unless the trade war has a "major impact" on global economic growth and clips demand for oil, Goldman believes the outlook for U.S. energy exports remains strong because an oil-hungry world will need American supplies in the coming years.