Stocks Rise; S&P, Nasdaq Log 4th Weekly Gains

Stocks eked out modest gains Friday, buoyed by a better-than-expected government jobs report, but still ended off their best levels following news of a "credit event" in Greece.

Meanwhile, the S&P 500 and Nasdaq logged gains for a fourth consecutive week.

The Dow Jones Industrial Average squeezed out a gain of 14.08 points, or 0.11 percent, to close at 12,922.02, led by JPMorgan . Hewlett-Packard led the laggards.

The S&P 500 gained 4.96 points, or 0.36 percent, to end at 1,370.87. The Nasdaq rose 17,92 points, or 0.60 percent, to finish at 2,988.34.

The CBOE Volatility Index, widely considered the best gauge of fear in the market, ended near 17 following a mid-week spike.

For the week, the Dow slipped 0.43 percent, while the S&P added 0.09 percent, and the Nasdaq climbed 0.41 percent. H-P was the biggest weekly decliner on the Dow, while Wal-Mart led the gainers.

Telecoms were the biggest sector gainers for the week, while materials lagged.

And today marks the three-year anniversary of the bull market following the global banking crisis. The Dow and the S&P 500 have both rallied almost 100 percent since the March 2009 lows, while the Nasdaq has surged more than 130 percent. (Read More: Stocks Double in 3 Years, But Many Stay on Sidelines)

In afternoon trading, Greece triggered the payment on default insurance contractsby using legislation that forces losses on all private creditors, according to the International Swaps and Derivatives Association. Earlier, ratings agency Fitch cut Greece's rating to "restricted default" over its bond swap deal.

Meanwhile, traders said the move had been widely expected, helping to limit the market's losses. And the euro remained little changed.

This comes a day after Greece completed the bond swap deal with private creditors, which was approved by nearly 84 percent of the bondholders.

On the economic front, employers added 227,000 jobs last month, according to the Labor Department, while the unemployment rate held steady at a three-year low of 8.3 percent. Economists polled by Reuters had expected a gain of 210,000.

"The economy continues to build momentum at a given rate and that helps reinforce confidence and that we could begin see more corporations hire again,” said Matt Kaufler, portfolio manager at Federated Investors. “[However,] if we get negative news on the geopolitical front, that could rattle the markets.”

Starbucks hit new all-time highs after the coffeehouse chain said it will introduce its own single-serving coffee brewing systemthat will compete with Green Mountain's popular Keurig machine. Meanwhile, S&P Capital IQ raised its rating on Starbucks to "buy" from "hold."

Texas Instruments slipped after the chipmaker lowered its earnings and revenue targetsfor the first quarter due to lower-than-expected wireless chip demand.

ExxonMobil nudged lower after at least two brokerages cut their price targets on the oil giant. This come a day after Exxon said its 2012 oil and natural gas output would drop 3 percent from last year.

ExpressScripts and Medco Health gained following news that the Federal Trade Commission seemed unlikely to block the proposed $29 billion mergerof the two prescription-drug benefit managers, according to reports.

Among earnings, Ann jumped after the women's clothing retailer forecast improved margins.

Carnival slipped after the cruise operator slashed its earnings and revenue outlook for the fiscal year, hurt by the cruise liner Costa Concordia disaster in January.

Homebuilders ralliedafter Credit Suisse raised its rating on Lennar , Toll Brothers and DRHorton to "outperform" from "neutral and Meritage and Ryland to "neutral" from "underperform."

Also on the economic front, U.S. trade deficit surged to $52.6 billion in January, the widest imbalance since October 2008as imports hit an all-time high, according to the Commerce Department. Exports were up a smaller 1.4 percent to $180.8 billion.

Meanwhile, wholesale inventories grew 0.4 percent in January, according to the Commerce Department. And sales dropped 0.1 percent, while analysts had forecast a 0.8 percent gain.

—Follow JeeYeon Park on Twitter: @JeeYeonParkCNBC

On Tap Next Week:

MONDAY: 3-yr note auction; Earnings from Urban Outfitters
TUESDAY: NFIB small business optimism index, retail sales, business inventories, 10-yr note auction, FOMC meeting announcement, Chevron analyst meeting, Disney shareholders meeting
WEDNESDAY: Weekly mortgage apps, current account, import & export prices, Ben Bernanke speaks, oil inventories, 30-yr bond auction; Earnings from
THURSDAY: Jobless claims, PPI, Empire state mfg survey, Philadelphia Fed survey, credit card default rates reported; Earnings from Ross Stores
FRIDAY: Quadruple witching, CPI, industrial production, consumer sentiment, New iPad sold in Stores

More From