U.S. stocks closed out their best week of the year with more gains on Friday and climbed to the cusp of their records.

The S&P 500 rose 0.5% for a fifth straight gain and is just 0.7% below its all-time high set in July. Rallies for Microsoft, Broadcom and other tech stocks helped it claw back almost all its losses from last week, which was its worst in nearly 18 months.

The Dow Jones industrial average jumped 297 points, or 0.7%, and at one point got within 30 points of its record set last month. The Nasdaq composite added 0.7%.

Uber Technologies helped drive the market higher with a gain of 6.4% after saying it will bring autonomous ride-hailing to Austin, Texas, and Atlanta with Waymo early next year.

Stocks also got support from the bond market, where Treasury yields eased ahead of next week’s meeting of the Federal Reserve. The unanimous expectation on Wall Street is for the Fed to deliver the first cut to interest rates in more than four years on Wednesday.

The federal funds rate is currently sitting in a range of 5.25% to 5.50%.

The yield on the 10-year Treasury eased to 3.65% from 3.68% late Thursday. The two-year yield, which more closely tracks expectations for Fed action, fell more sharply to 3.58% from 3.65%.

On Wall Street, home-furnishings company RH jumped 25.5% after reporting stronger profit and revenue for the latest quarter than expected.

Oracle pared a big early gain to inch up 0.4% after giving long-term financial forecasts that analysts said topped their expectations. That brought the software company’s gain to 14.3% for the week.

Nvidia rallied 15.8% over the week despite slipping 0.1% on Friday.

On the losing end of Wall Street Friday was Boeing, which lost 3.7% as aircraft assembly workers walked off the job.

Adobe fell 8.5%, even though the company also reported better profit for the latest quarter than expected.

All told, the S&P 500 rose 30.26 points to 5,626.02. The Dow gained 297.01 to 41,393.78, and the Nasdaq composite added 114.30 to 17,683.98.

— Associated Press