US stocks resumed their rally as investors weighed bets that the Federal Reserve's interest-rate hikes are nearing an end against evidence of a slowdown in China's economy.

The S&P 500 rose 0.4%, while the tech-heavy Nasdaq 100 rose 0.8%, adding to last week's historic gains amid hopes that the Fed will soon be able to declare victory over inflation.

Activision Blizzard gained after Microsoft and British regulators held "productive" talks to finalize the $69 billion merger. Ford fell after lowering the price of its electric F-150 truck. The dollar fluctuated, and equities in Europe and mainland China fell after China's GDP grew at a slower-than-expected rate in the second quarter, raising risks to the global economy.

Yellen believes the United States is on a "good path" to lowering inflation without causing a significant contraction in the labor market.