NEW YORK, June 8 — US stocks rallied late on Tuesday to end higher for a second straight day as technology and energy shares gained, while Target Corp’s warning about excess inventory weighed on retail stocks for much of the session.

Apple Inc AAPL.O shares climbed 1.8 per cent despite news earlier in the day that the company must change the connector on iPhones sold in Europe by 2024 after EU countries and lawmakers agreed to a single charging port for mobile phones, tablets and cameras.

The S&P 500 technology index .SPLRCT rose 1 per cent and gave the benchmark index its biggest boost. Microsoft Corp MSFT.O shares added 1.4 per cent.

The S&P 500 energy sector index .SPNY jumped 3.1 per cent to end at its highest level since 2014, with oil prices sharply higher.

At the same time, shares of Target Corp TGT.N fell 2.3 per cent after the retailer said it would have to offer deeper discounts and cut back on stocking discretionary items.

Equity trading was choppy, with indexes down early in the day, but the market has been recovering from recent steep losses.

Recently, “we’ve had a nice bounce ... and in general investors are feeling better right now. But we are very much in a seesaw market as we’ve seen all year,” said Tim Ghriskey, senior portfolio strategist at Ingalls & Snyder in New York.

“At some point, we will put in a bottom, and the market will move higher. We have a hard time believing that’s any time soon, given a number of fundamental issues overhanging the market,” he said. “Certainly what we’ve seen today from Target isn’t good news in terms of the consumer.” Long-dated US Treasury yields tumbled after the Target news, however, as it fueled some speculation that the worst of inflation may be in the past.

The Dow Jones Industrial Average .DJI rose 264.36 points, or 0.8 per cent, to 33,180.14, the S&P 500 .SPX gained 39.25 points, or 0.95 per cent, to 4,160.68 and the Nasdaq Composite .IXIC added 113.86 points, or 0.94 per cent, to 12,175.23.

Shares of Walmart WMT.N fell 1.2 per cent, and the S&P retail index .SPXRT was down 1 per cent.

Consumer price data on Friday is expected to show that inflation remained elevated in May, though core consumer prices, which exclude the volatile food and energy sectors, likely ticked down on an annual basis.

Not all retailers were in the red. Kohl’s Corp KSS.N shares jumped 9.5 per cent after news the department store chain entered exclusive talks with retail store operator Franchise Group Inc FRG.O over a potential sale that would value it at nearly US$8 billion (RM35.1 billion).

Advancing issues outnumbered declining ones on the NYSE by a 2.36-to-1 ratio; on Nasdaq, a 1.69-to-1 ratio favored advancers.

The S&P 500 posted 3 new 52-week highs and 30 new lows; the Nasdaq Composite recorded 35 new highs and 121 new lows.

Volume on US exchanges was 10.38 billion shares, compared with the 12.50 billion average for the full session over the last 20 trading days. — Reuters