Stocks began 2019 with the snappiest start in more than three decades, as the economy grew faster than expected, the Federal Reserve seemed to abandon its plans to keep raising interest rates, and trade-war rancor between Washington and Beijing seemed to end. By April 30, the S&P 500 had reached a record.

Then the tweets on trade began. In early May, President Trump threatened new tariffs on Chinese products, shattering the calm as markets began a tailspin that was capped with a 1.3 percent drop for the S&P 500 on Friday.

The benchmark index ended May down 6.6 percent, its first monthly decline of the year and its worst drop since an ugly sell-off at the end of 2018.

The decline on Friday came after President Trump tweeted that he would impose a new tariff on all imports from Mexico — a tax that could rise to as high as 25 percent — unless the country’s government took steps to address the flow of migrants across the United States’ border, and Beijing announced plans to unveil a blacklist of foreign companies and people. China’s move was seen as a retaliation against the Trump administration’s efforts to deny American technology to Chinese companies.