By Ben Eisen and Sam Goldfarb 

U.S. stocks climbed Wednesday, extending a steady August rally that has pushed the S&P 500 to the cusp of its first record close since the coronavirus pandemic brought the economy to a halt.

The benchmark U.S. stock index has risen in all but one trading session this month, buoyed by the prospect of declining coronavirus cases at a time when the federal government and central banks are still supporting the economy.

The S&P 500 opened modestly higher Wednesday and flirted with record levels for much of the day, finally eclipsing February's closing high in the final hour of the session. But the index couldn't hold on, ending just shy of the record and setting its second-highest close in history.

"There's optimism right now about an environment where the virus situation gets better, but we still have a ton of stimulus in the system, " Ilya Feygin, a managing director at broker-dealer WallachBeth Capital.

The S&P 500 ended the day up 46.66 points, or 1.4%, at 3380.35, drawing within 0.2% of the Feb. 19 high. It is now up 3.3% in August and 4.6% for the year.

The Dow Jones Industrial Average climbed 289.93 points, or 1%, to close at 27976.84, and the technology-heavy Nasdaq Composite Index advanced 229.42 points, or 2.1%, to 11012.24, snapping a three-session losing streak.

Shares of semiconductor companies and beaten-down energy stocks led the way. Advanced Micro Devices surged 7.5%, while ConocoPhillips gained 4.9% and Apple rose 3.3%, edging closer to a $2 trillion market value.

The rally in the stock market has coincided with a rise in U.S. government bond yields, a further sign that investors are growing somewhat more optimistic about the economic outlook. Meanwhile, gold prices have fallen this month and oil prices have climbed.

Some analysts and investors caution that the stock market is susceptible to a reversal if virus cases begin to rise again or future stimulus efforts disappoint. Others have pointed to unpredictable trading behavior where stocks continually rise with few fundamental drivers, much like during the dot-com boom.

"You have a lot of things that are very reminiscent of a late-90s melt-up," said Chris Harvey, head of equity strategy at Wells Fargo & Co. He said he doesn't expect the market to crash but believes stock gains are likely to be muted in the next few months.

Investors are keeping a close eye on lawmakers' negotiations over a new coronavirus-relief package for American households and businesses. Senate Majority Leader Mitch McConnell said earlier in the week that talks were "at a bit of a stalemate." Still, many investors remain optimistic that a deal will be reached.

"Markets, particularly in the last day or so, seem to be pricing in a stimulus even as lawmakers play down the odds," said Edward Park, deputy chief investment officer at Brooks Macdonald, an investment management firm.

Traders also said the market was supported by Democratic presidential candidate Joe Biden's announcement that Kamala Harris would be his running mate. Wall Street veterans widely consider Ms. Harris to be a more moderate choice than others who were in contention for a spot on the ticket.

The technology sector was the best performing group in the S&P 500 Wednesday, jumping 2.3%. Microsoft shares added 2.9%, and Tesla, which isn't in the index, rose 13% after the electric-car maker late Tuesday said it would enact a 5-for-1 stock split.

While technology firms have been this year's star performers, the market has been supported of late by stocks that are more sensitive to the economy and had been hit particularly hard during the pandemic's early days. The S&P 500 financial sector has climbed 5% this month and the energy sector has risen 6.6%.

In bond markets, the yield on the benchmark 10-year Treasury note gained for a fourth day, ticking up to 0.669%, from 0.657% Tuesday and 0.541% a week earlier. The yield reached its highest level since July 6.

Yields, which rise when bond prices fall, started climbing last Friday after the Labor Department reported better-than-expected jobs numbers for July. A series of large debt auctions have further pressured the market, as has the decline in coronavirus cases and the rally in stocks.

Bond yields tend to rise when investors feel better about the economy, since faster growth can lead to inflation, which erodes the purchasing power of bonds' fixed payments and can put pressure on the Fed to raise interest rates. Fresh inflation data showed that U.S. consumer prices increased by 0.6% in July, more than the average expectation of 0.3%, according to FactSet.

Yields, notably, remain near historic lows and could have difficulty rising much further, given the still murky economic outlook and signals from Fed officials that they might hold off on raising rates until inflation exceeds their 2% inflation target, analysts say.

In the meantime, many analysts believe that low yields have played a major role in propelling stocks back to their previous highs, since they lower the cost of borrowing for businesses and drive investors to buy riskier assets in search of returns.

Gold prices edged 0.1% higher, after the commodity on Tuesday fell by the most since March. Analysts said appetite for gold has been eroded this week by the rise in Treasury yields. The precious metal -- usually viewed as a haven asset that investors flock to when stocks are in tumult -- has climbed this year even as equities advanced.

Anna Isaac contributed to this article

Write to Ben Eisen at ben.eisen@wsj.com and Sam Goldfarb at sam.goldfarb@wsj.com

 

(END) Dow Jones Newswires

August 12, 2020 18:03 ET (22:03 GMT)

Copyright (c) 2020 Dow Jones & Company, Inc.