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%.

If you liked this article you might like

Paradigm Opportunity Protects Investors in Tough Times

5 Things You Need to Know Before the Stock Market Opens (Correct)

U.S. Investors Brace for a Third Bailout in Greece

5 Things You Need to Know Before the Stock Market Opens

40 Hedge Funds' Best Stocks Show the Way for 2012 (Update 1)