NEW YORK — U.S. stocks climbed Tuesday as the price of oil made its biggest jump in seven months and energy companies rose with it. Technology stocks such as Microsoft and Google parent Alphabet traded higher and bond yields slipped, a break with the pattern since last week's election.

Oil rose almost 6 percent as investors once again grew hopeful that the OPEC cartel will agree to cut fuel production in a few weeks. Companies such as utilities and telecom service providers climbed as bond yields fell slightly after a week of large gains. Airlines rose after billionaire Warren Buffett made a surprise investment in three carriers.

“The market somehow decided ‘let's give the Trump presidency a chance,'?” said John DeClue, chief investment officer for U.S. Bank's private client reserve. However, DeClue said the bond market could struggle with Donald Trump in the White House: If taxes are cut and government spending rises sharply, that could lead to climbing deficits, which would trouble investors in U.S. government debt.

The Dow Jones industrial average picked up 54.37 points, or 0.3 percent, to 18,923.06, as those gains were partly held back by losses for retailer Home Depot and aerospace company Boeing. The Standard & Poor's 500 index rose 16.19 points, or 0.7 percent, to 2,180.39. The Nasdaq composite added 57.23 points, or 1.1 percent, to 5,275.62.

Energy companies such as Exxon Mobil and Occidental Petroleum made large gains as the price of oil rose by the largest amount since early April. At least for a day, investors were hopeful that the nations of OPEC will be able to hammer out a deal to cut oil production, which would boost prices. OPEC agreed to a preliminary deal in September but still has to work out important details.

Benchmark U.S. crude gained $2.49, or 5.7 percent, to $45.81 per barrel in New York. Brent crude, used to price international oils, rose $2.52, or 5.7 percent, to $46.95 a barrel in London. Exxon rose $1.54, or 1.8 percent, to $86.82 and Apache added $4.46, or 7.6 percent, to $63.39.

Tuesday's trading was a partial reversal of the moves investors have made since the presidential election one week ago. Tech stocks had been losing ground recently, but Microsoft picked up $1.14, or 2 percent, to $58.87, and graphics processor maker Nvidia rose $2.55, or 3 percent, to $86.19.

Bond prices edged higher, sending long-term interest rates slightly lower. Bond prices had fallen sharply since the election over worries that President-elect Trump's spending plans would lead to higher inflation. That had sent yields to their highest levels this year. But the yield on the 10-year Treasury note declined to 2.23 percent from 2.27 percent. Companies that pay large dividends, like phone companies, also changed course and rose.

However, the dollar continued to get stronger and reached its highest level in almost a year. It rose to 109.32 yen from 108.51 yen. The euro slid to $1.0718 from $1.0726.

Buffett's Berkshire Hathaway bought stock in United Continental, American Airlines and Delta.

Buffett has avoided the volatile industry, but his holding company disclosed stakes in each company in a form filed with the Securities and Exchange Commission.

United picked up $3.12, or 5 percent, to $66.06, and American gained $1.36, or 3.1 percent, to $44.76.

Boeing fell after United said that it will postpone delivery of 61 new Boeing 737 jets that it planned to buy. It will convert the orders to a new, more fuel-efficient model that Boeing calls the 737 Max. Boeing stock lost $1.88, or 1.3 percent, to $148.11.

In other energy trading, wholesale gasoline rose 6 cents, or 4.5 percent, to $1.34 a gallon. Heating oil picked up 6 cents, or 4.2 percent, to $1.44 a gallon.