By Anna Isaac and Alexander Osipovich

U.S. stocks wavered Monday, though the major equity benchmarks are on track to close out their best month since April.

The S&P 500 slipped less than 0.1% but is still on track for a 7.2% advance in August. It has posted gains in all but four trading days this month. The broad-based index has rebounded in every month since April, when it climbed nearly 13%, after suffering brutal losses in February and March.

In Monday's session, the Dow Jones Industrial Average fell 0.8%, while the technology-heavy Nasdaq Composite Index gained 0.7%. Those indexes are on track for monthly gains of 7.6% and 9.7%, respectively.

Both the S&P 500 and the Nasdaq notched all-time highs at the end of last week as the summer-vacation season began drawing to a close. Optimism was buoyed by a shift in the approach to monetary policy from the Federal Reserve, which has signaled that it is likely to keep U.S. borrowing costs down for an extended period.

"They've confirmed lower-for-longer rates as far as the eye can see," said Richard Dunbar, head of multi asset research at Aberdeen Standard Investments. "Alongside that confirmation of cheap money and cheap discount rates, we've just come through a U.S. earnings season that's been a lot better than feared."

A top Fed official affirmed the U.S. central bank's new stance on Monday. Fed Vice Chairman Richard Clarida said in a speech that the Fed shouldn't tighten monetary policy just because of low unemployment, and cast doubt on economic models that the Fed used in the past to justify raising interest rates.

Still, some investors are bracing for a potential reversal in September. U.S. lawmakers are scheduled to return to work following an August recess and could resume talks to end the gridlock on a new coronavirus stimulus package as November election campaigns go into full swing. A failure by Congress to deliver additional relief measures for American consumers and businesses could weigh on market sentiment.

"There's uncertainty about future support," Mr. Dunbar said. "Investors are nervous generally, and keen to see support continue through low interest rates and fiscal policy. Any discussion of that being disrupted can make investors nervous."

Energy and industrial stocks were the worst-performing sectors of the S&P 500 on Monday, while health-care and consumer-discretionary stocks were the best-performing sectors.

Walmart shares dropped 2.2%, weighing on the Dow, after China unveiled new technology-export restrictions that could complicate the sale of the U.S. operations of TikTok. The retail giant is among the companies that have expressed interest in the popular video app.

Shares of other companies involved in the TikTok talks also declined Monday, with Oracle slipping 1% and Microsoft down 1.5%.

Apple shares climbed 3.7% after the company's 4-for-1 stock split took effect, while Tesla jumped 8.3% after its 5-for-1 split. Stock splits, which have been less common in recent years, often result in a bounce in a company's stock price.

Going into the autumn, the strength of the economic recovery may be tested if the number of new coronavirus infections in the U.S. and Europe increases and prompts fresh restrictions on business activity.

"Basically for the U.S. market, we are at a key resistance level," said Nadège Dufossé, head of cross-asset strategy and deputy global head of multiasset allocation at Candriam. "If the market continues to turn more positive, it will benefit value; European and emerging markets' stocks will benefit as investors look beyond the U.S. for returns."

Investors are braced for a surge in volatility stemming from any uncertainty or dispute about the results of the U.S. presidential election, or a sharp deterioration in relations between Beijing and Washington.

"There are only two main themes being played by stock markets. The strong belief in the rebound of all economies -- they are still ignoring the fact that after a V-shaped rebound, the real recovery will have a different shape -- and the strong belief in central banks," said Carsten Brzeski, chief economist for the eurozone at the research division of ING Bank.

"These are completely outweighing the announcements that have the longer-term implications for the global economy," he added.

Overseas, the pan-continental Stoxx Europe 600 fell 0.6%.

Major Asian markets closed lower, with the exception of Japan. The Nikkei 225 index rose 1.1% after Warren Buffett's Berkshire Hathaway said it bought stakes in five of Japan's top corporate names that have big investments in energy. Berkshire took stakes of slightly more than 5% in Mitsubishi, Mitsui, Sumitomo, Itochu and Marubeni, sending the shares of those companies surging. The five gained between 4.2% and 9.5%.

In bond markets, the yield on the benchmark 10-year Treasury fell to 0.695%, from 0.727% Friday.

In commodities, futures on Brent crude, the benchmark for global oil prices, slipped less than 0.1% to $45.80 a barrel.

--Frances Yoon contributed to this article.

Write to Anna Isaac at anna.isaac@wsj.com and Alexander Osipovich at alexander.osipovich@dowjones.com