Updated from 4:11 p.m. EST

Stocks started sluggish amid tech sector warnings and higher oil prices, but a steady rally from late morning helped the major indices close higher again Friday.

For the Dow Jones Industrial Average, it was another record finish, its 24th since October. The Dow gained 41.10 points, or 0.33%, to 12,556.08, and the S&P 500 added 6.91 points, or 0.49%, at 1430.73. The Nasdaq Composite was ahead by 17.97 points, or 0.72%, to 2502.82.

"We have another long weekend, so people have hit the exits early today," said Jay Suskind, head of institutional equity trading with Ryan Beck & Co. "As we get to more earnings and economic numbers next week, the market will take its cue from there."

The market will be closed Monday for the Martin Luther King Jr. observance.

All told, the Dow was higher for the week by 158 points, or 1.3%, and the S&P 500 added 21 points, or 1.5%. The Nasdaq, meanwhile, surged 69 points, or 2.8%.

Volume was strong to end the week, with 2.70 billion shares changing hands on the New York Stock Exchange. Advancers beat decliners by a 2-to-1 margin. Volume on the Nasdaq reached nearly 2.16 billion shares, and winners outpaced losers 3 to 2.

By sector, oil stocks were the big winners. The Philadelphia Oil Service Sector Index jumped 2.8%, and the Amex Oil Index added 3.1%. Utility stocks were hit hardest, with the Philadelphia Utility Index slumping 0.8% and the Dow Jones Utilities Index finishing lower by 0.7%.

Technology led the market's advance during the previous session, as the Nasdaq gained 25.52 points, or 1.04%, and the same happened again.

Even late warnings by SAP ( SAP) and Advanced Micro Devices ( AMD) failed to keep the bulls stuck on the sidelines.

Software giant SAP slumped in Germany but rose 3.3% in U.S. trading despite its poor forecast. Rival Oracle ( ORCL) tacked on 0.6%. AMD dove 9.5% to close at $18.26 following its own disappointing numbers, but the overall market shrugged off the cautious comments.

Crude oil prices gained ground after a four-day drop that has seen the near-month futures contract fall to a 19-month low. OPEC announced it will consider an emergency meeting to discuss the recent drop in crude and ponder new production cuts. The group has already set plans to reduce output by 1.7 million barrels.

For the year, oil has fallen roughly 15%. February crude was stronger by $1.11 to close at $52.99 a barrel. Other energy contracts were higher, as well.

On the economic docket, the Commerce Department said U.S. retail sales rose a better-than-expected 0.9% in December. Excluding autos, retail sales were higher by 1%.

Ian Shepherdson, chief economist with High Frequency Economics, said retail sales "had been weak as the housing crunch depressed sales of appliances, but the combination of the plunge in gas prices and the holidays has generated a sudden surge, which we do not expect to last."

Separately, the government said U.S. business inventories rose 0.4% in November, above estimates. Elsewhere, the Labor Department said import prices increased 1.1% in December, above economists' forecasts. Compared to a year ago, import prices have risen 2.5%. The increase was blamed on rising petroleum prices, which were up 4.8%, the largest gain in seven months.

Treasuries dropped following the data. The 10-year was falling by 10/32, yielding 4.77%, and the 30-year bond slid 20/32 to lift the yield to 4.86%.

The dollar eased against other major currencies. Meanwhile, gold jumped $13 to $626.90 an ounce, and silver surged by 42 cents at $12.88 an ounce.

Investors also welcomed a speech from Boston Federal Reserve President Cathy Minehan, who said that while inflation remains a challenge for the Fed to grapple with, price pressures may be easing. On Thursday, Minehan, who is set to become a voting member of the Fed's policy-setting Federal Open Market Committee, announced her retirement.

Returning to corporate news, Cablevision Systems ( CVC) fell 4.1% after the Dolan family raised its final buyout offer to $9.8 billion in order to take the company private. Shares shed $1.21 to $28.39.

Among analyst moves, Banc of America Securities upped its price target for Apple ( AAPL) to $105 from $93 and raised IBM's ( IBM) price target to $110 from $100.

Still, Apple was lower by $1.18, or 1.2%, to close at $94.62. IBM gained 63 cents, or 0.6%, to $99.28.

Overnight in Asia, Japan's Nikkei rose 1.3% to 17,057, and Hong Kong's Hang Seng added 1.2% to 19,613. In Europe, London's FTSE 100 was up 0.1% to 6239. Germany's Xetra DAX was higher by 0.3% to 6705.

More from Markets

Apple Shares Gain as U.S. and China Call Off Trade War, For Now

Apple Shares Gain as U.S. and China Call Off Trade War, For Now

Tesla Shares Jump on New $78,000 Model 3 Plan, China Trade War Truce

Tesla Shares Jump on New $78,000 Model 3 Plan, China Trade War Truce

Global Stocks Rally as US-China Trade War Thaws; Dow Could Test 25,000

Global Stocks Rally as US-China Trade War Thaws; Dow Could Test 25,000

Video: There Are Some Big Changes Coming to the PGA Championships in 2019

Video: There Are Some Big Changes Coming to the PGA Championships in 2019

Video: One-on-One With Pluralsight's CEO Following Its Successful IPO

Video: One-on-One With Pluralsight's CEO Following Its Successful IPO