Stocks closed modestly higher Friday after the government’s monthly report on employment bolstered hopes that the economic recovery is on track. The gains were tempered by news that a big debt write-down by Greece could cause big losses for some banks.

Three years after stocks hit bottom during the Great Recession, the Dow Jones industrial average rose 14 points and finished the week with a loss of just 56. That was after a 203-point dive Tuesday, the worst drop so far this year. The Dow was up more than 60 points Friday morning but lost ground in the afternoon after the trade group that oversees financial derivatives said Greece’s bond-swap deal will trigger payouts on bond insurance.

The Dow finished up 14.08 points, or 0.1 percent, at 12,922.02. The Standard & Poor’s 500 gained 4.96, or 0.4 percent, to 1,370.87. The Nasdaq composite average gained 17.92, or 0.6 percent, to 2,988.34.

The Dow has nearly doubled in the three years since its bottom during the financial crisis. On March 9, 2009, it closed at 6,547. The S&P 500 closed that day at 676.

The morning’s gains were driven by news that employers added 227,000 jobs last month, finishing three of the best months for hiring since the recession began. The unemployment rate was unchanged at 8.3 percent because unemployed people started looking for work again, which increased the size of the labor force.

The hiring was spread across a range of industries, including business and professional services, leisure and hospitality and health care.

Later Friday, the International Swaps and Derivatives Association said it had determined that a massive bond-swap by Greece constituted a “credit event,” meaning that holders of credit-default swaps on their Greek bonds will be able to claim insurance payments. Traders sold stocks on the news, fearing big losses for banks that had sold the insurance.

Greece convinced most of its private creditors to swap their bonds for new ones worth far less. The deal clears the way for a fresh bailout from Greece’s neighbors. Fears of a disorderly Greek default have weighed on the market for two years.

“There’s a lot less imbalance and a lot less uncertainty than there was three years ago,” said John Canally, investment strategist with LPL Financial Corp. Canally said the odds of another recession have been dropping as the economic recovery strengthens and becomes less vulnerable to shocks.

For the week, the Dow lost 55.55 points, or 0.4 percent. It was the second straight week of modest losses for the Dow, which closed above 13,000 last week for the first time since May 2008.

Canally said investors should be prepared for the stock market’s rally to fade after significant gains so far this year. He said his firm had slowed stock purchases because the market had gained as much in two months as he expected it to gain all year. The Dow is up 6 percent for the year, the S&P 500 9 percent.

European stocks added to their gains after the U.S. market opened. France’s benchmark indexes closed 0.3 percent higher, Britain’s 0.5 percent higher and Germany’s 0.7 percent higher.

Also Friday, the Commerce Department said the U.S. trade deficit surged in January to the widest imbalance in more than three years as imports hit an all-time high, reflecting rising demand for foreign-made cars, computers and food products.

Exports to Europe fell, raising concerns that economic contraction across most of the continent will hurt U.S. corporate profits.

Some of the stocks that made big moves on Friday:

— Green Mountain Coffee Roasters Inc. plunged 16 percent after its larger rival, Starbucks Corp., said it will start selling single-cup coffee machines. That could deflate demand for Green Mountain’s Keurig machines. Starbucks rose 3 percent.

— Texas Instruments fell 1 percent after the chipmaker lowered its forecast for revenue and earnings in the first quarter, blaming weaker demand for wireless products.

— Smith & Wesson Holding Corp. leaped 23 percent after the maker of guns and security systems beat analysts’ expectations for third-quarter earnings and raised its full-year guidance.