New York CNN Business  — 

It was quite a week for the markets.

The Dow recorded its worst week since March. For the S&P 500 and the Nasdaq it was the worst since December. Global stocks got slammed, too.

The culprit: Fear of a trade war with China. Tensions between Washington and Beijing escalated this week, culminating in an increase in tariffs on Chinese imports on Friday.

This is how we got here.

Sunday: Trump made threats

President Donald Trump in a tweet threatened to raise tariffs on some $200 billion of Chinese goods from 10% to 25%.

Monday: Stocks plunged early

Stocks plunged early Monday in response to Trump’s comments. But as investors assessed the risk of escalating tensions, the initial panic eased. After all, Chinese Vice Premier Liu He remained scheduled to travel to Washington for the next round of trade talks. This gave the market hope something could be worked out, and stocks pared their losses into the close.

After the close, however, Treasury Secretary Steven Mnuchin and US trade representative Robert Lighthizer confirmed that new tariffs were a very real risk. Futures took a tumble.

Tuesday: The really bad day

In hindsight, Monday looked like the calm before the storm.

The Dow (INDU) dropped 473 points on Tuesday, falling below 26,000 points. It was the index’s worst one-day percentage drop since January 3. The S&P 500 (SPX) and Nasdaq (COMP) also tumbled, with the latter falling below 8,000 points for the first time since April 18.

Wednesday: Up and down

In a tweet, Trump said China Vice Premier Liu He was coming to Washington to make a deal. Then, White House Press Secretary Sarah Sanders also told reporters that China informed the administration that Beijing indeed wanted to make a deal.

All that positivity caused stocks to rebound. The Dow even eked out a gain, albeit just barely, closing up 2 points.

Then, Trump said he decided to raise tariffs on Chinese imports because China “broke the deal.”

Thursday: Time for trade talks

Those comments weighed on stocks Thursday. At one point, the Dow fell more than 400 points. But Trump spurred some optimism after saying he had received a “beautiful” letter from Chinese President Xi Jinping. He also said the two parties were “getting very close” to a trade agreement. The Dow ended the day down more than 100 points, while the S&P 500 and the Nasdaq finished 0.3% and 0.4% lower, respectively — the fourth straight day those two had ended in the red.

Friday: No deal but optimism

At 12:01 am ET on Friday, the threatened tariff increase went into effect — though it isn’t expected to apply to goods already in transit. Trump took to Twitter and praised his tariff strategy.

Trading was volatile. At its worst, the Dow was more than 300 points lower. But the picture brightened when Mnuchin called Friday’s negotiations with China “constructive.” During the final hour of trading, Trump tweeted that the conversations with China had been “candid and constructive,” that his relationship with President Xi remained strong and that talks will continue. Investors responded favorably, and the Dow finished the day up 114 points, or 0.4% higher. The S&P and the Nasdaq snapped a four day losing streak.

Those gains couldn’t repair all of the week’s damage, but Friday helped the week end with some cautious optimism. We’ll see whether that will hold.