Stocks closed lower on Wednesday, erasing sharp gains, as positive news on the trade front was not enough to fend off declines in tech and financials shares.

The Dow Jones Industrial Average fell 165.52 points to close at 24,117.59, with Intel among the worst-performing stocks in the index. The pulled back 0.9 percent to 2,699.63 as tech fell 1.5 percent. The Nasdaq composite dropped 1.5 percent 7,445.08, as Amazon and Alphabet declined 1.8 percent and 1.4 percent, respectively. Declines in Facebook and Netflix also pushed the Nasdaq lower.

Financials gave back gains from earlier in the session, notching a record 13 straight days of losses. The Financials Select Sector SPDR Fund (XLF) closed 1.3 percent lower. Bank of America, J.P. Morgan Chase, Morgan Stanley and Citigroup all fell at least 1 percent.

The Dow rose as much as 285.91 points earlier in the session as a crackdown on Chinese tech investments by the Trump administration was less restrictive than expected.

The government will rely on the newly strengthened Committee on Foreign Investment in the United States to deal with concerns about foreign purchase of sensitive domestic technologies , a senior administration official said Wednesday.

“If you look at the day-to-day gyrations, it’s the unknowns around trade that’re driving the market,” said Phil Blancato, CEO of Ladenburg Thalmann Asset Management. “This seems like a targeted approach (by the Trump administration), which is smart, rather than a broad-brush approach” to trade.

Reports earlier in the week suggested that the White House would more actively restrict investment in technology firms by Chinese companies, but instead it appears it will rely on CFIUS. Treasury Secretary Steven Mnuchin told CNBC's "Squawk Box" that the department can block U.S.-China ventures if there is technology transferred, however.

"Clearly, this was not as onerous as people thought," said Marc Chaikin, CEO of Chaikin Analytics. "I think investors have to stay the course and ignore the headlines."

"We've got a mercurial president that says one thing but could very quickly change his mind or do something different," Chaikin said.

Prior to the administration's announcement, stock index futures had fallen sharply, with Dow futures indicating steep losses for the open. Futures immediately recovered following the announcement.

Markets around the world have been on a roller-coaster ride in recent weeks as fears around trade tensions between the U.S. and other major economies escalate. Not only is the U.S. in a tit-for-tat war of words with China on tariffs, but now the European Union is involved.