The S&P 500 eked out a fractional gain on Wednesday after a see-saw session, as investors weighed whether to start bargain hunting following a sell-off fueled by elevated Treasury yields and uncertainty about the path ahead for interest rates.

Investors were also attuned to developments in Washington as divisions among U.S. lawmakers put the federal government at risk of a partial shutdown by the weekend.

A possible shutdown has added to worries for stock investors as they grapple with benchmark Treasury yields that have climbed to 16-year highs after the Federal Reserve last week signaled a hawkish long-term path for interest rates.

At the same time, as the S&P 500 has sharply pared its year-to-date gain, some investors are wondering if the market is close to a bottom.

"At some point people will start to buy stocks for the fourth quarter, and the third-quarter selling might be almost done," said Peter Tuz, president of Chase Investment Counsel.

"At a certain level, people are going to get back in thinking the fourth quarter might be a pretty good one."

The Dow Jones Industrial Average fell 68.61 points, or 0.2%, to 33,550.27, the S&P 500 gained 0.98 points, or 0.02%, at 4,274.51 and the Nasdaq Composite rose 29.24 points, or 0.22%, to 13,092.85.

During the session, the S&P 500 rose as much as 0.4% and fell as much as 0.8% before paring losses.

Among S&P 500 sectors, the rate-sensitive utilities group fell most, dropping 1.9%. Energy rose 2.5%, as Brent crude breached $97 a barrel, with the jump in oil prices posing a renewed threat to inflation that has been moderating.

The S&P 500 has fallen about 7% since late July, but remains up over 11% for 2023.

"Investors are looking for a turning point," said Art Hogan, chief market strategist at B. Riley Wealth. "Clearly, it is not going to take much of a breath of fresh air in this market for people to chase this."

In Washington, Republican U.S. House Speaker Kevin McCarthy rejected a stopgap funding bill advancing in the Senate, bringing the government closer to its fourth partial shutdown in a decade.

Data on Wednesday showed orders for long-lasting U.S. manufactured goods rose in August while business spending on equipment appeared to regain momentum after faltering early in the third quarter.

Investors are focusing on Friday's monthly personal consumption expenditures price index for a fresh view of inflation. This week also brings second-quarter Gross Domestic Product and remarks from Federal Reserve Chair Jerome Powell.

In company news, Costco Wholesale shares rose 1.9% after the retailer topped market estimates for quarterly revenue and profit.

Declining issues were roughly split with advancers on the NYSE. There were 56 new highs and 440 new lows on the NYSE.

On the Nasdaq, advancing issues outnumbered decliners by a 1.1-to-1 ratio. The Nasdaq recorded 35 new highs and 333 new lows.

About 10.9 billion shares changed hands in U.S. exchanges, compared with the 10.2 billion daily average over the last 20 sessions.

(Reporting by Lewis Krauskopf, Sinead Carew and Herbert Lash in New York, Ankika Biswas, Shashwat Chauhan and Amruta Khandekar in Bengaluru; Editing by Maju Samuel and Richard Chang)