The stock market rose on Wednesday, approaching a record, and the benchmark S&P 500 stock index briefly traded above 3,000 for the first time.

Investors cheered the potential for an interest-rate cut, which would make stocks more appealing. In testimony before Congress on Wednesday, Jerome H. Powell, the Federal Reserve chair, raised concerns about a global slowdown hurting the United States, laying the groundwork for a cut later this month.

The weak outlook for growth is partly a result of the trade war, which the central bank recently said could discourage business spending and may be contributing to a manufacturing slowdown. That weakening also has the potential to hurt the stock market, especially if the Fed’s policy moves aren’t enough to offset a slump.

But right now, stocks appear to be in a sweet spot, as the economy and corporate profits continue to grow and borrowing costs seem likely to come down.