The stock market scored its sharpest weekly gain in two years.

The Standard & Poor’s 500 index, a broad market gauge, rose 1.44 percent Friday to end the week up 5.62 percent.

The index recovered much of the ground it had lost since the end of April, when an earlier rally peaked.

“The bull market is still very much intact,” said Christopher Verrone, head of technical analysis at Strategas Research Partners, a brokerage for institutional investors.

Friday’s increase reflected an unexpectedly optimistic report from the nation’s manufacturers.

Based on a monthly survey by the Institute for Supply Management, an index of manufacturing activity rose to 55.3 in June from 53.5 in May. Measures above 50 on the scale indicate growth in the sector.

New orders, production and employment among manufacturers all increased in June, according to ISM.

It was the 23rd consecutive month the survey found expansion in manufacturing. ISM said that, based on the historical relationship between its index and the overall economic growth rate, the average index reading for the first half of this year points to a 5.7 percent annual increase in real gross domestic product.

The report was much more comforting than feared, suggesting that the pressure of rising commodity costs and the disruptions caused by Japan’s natural disaster may be starting to ease, wrote Nigel Gault, chief U.S. economist at IHS Global Insight.

But it also contained some cautionary findings. Growth in exports slowed, and the increase in the index was driven mainly by customers accumulating inventories of manufactured goods rather than a surge in new orders, Gault wrote.

Exports have helped make up slack in the U.S. economy.

Over the course of the week, investors shrugged off two potentially discouraging developments. In Washington, political negotiations to raise the federal debt ceiling deteriorated, and the Federal Reserve ended a long-running program, known as QE2, to boost the economy.

On other fronts, the week left investors with fewer grounds for anxiety.

Greece adopted austerity measures, at least temporarily defusing the danger that its debt would drag down the global economy.

If that didn’t put to bed “some of your Armageddon fears,” it put them on the back burner, said Jim Paulsen, chief investment strategist at Wells Capital Management.

Meanwhile, Bank of America agreed to pay billions of dollars to settle claims over troubled mortgage-backed securities, removing an element of uncertainty about additional fallout from housing’s go-go era.

The weekly showing was a rebound for the S&P 500 index, which had declined in six of the seven preceding weeks.

The 5.62 percent weekly gain was the biggest since July 2009, said Howard Silverblatt, senior index analyst at Standard & Poor’s. The S&P’s point gain was the largest since March 2009.

Energy stocks in the S&P 500 led the charge, rising 7.17 percent for the week, according to an S&P index. The information technology group rose 6.79 percent, and an index of stocks tied to consumer discretionary spending rose 6.56 percent, Silverblatt reported.

Bringing up the rear were utilities, up 3.3 percent, and companies that provide consumer staples, up 2.87 percent.

Investors’ support for the consumer discretionary group was a particularly noteworthy bellwether, Paulsen said, because those companies benefit from purchases that tend to accompany an economic rebound, such as household furnishings, appliances and autos.

The Dow Jones Industrial Average was up 1.36 percent Friday and 5.43 percent for the week, which was its largest weekly percentage gain since a 7.33 percent surge in July 2009.

The Dow rose 648.19 points this week, its biggest point gain since November 2008. Since the beginning of this year, the Dow is up 8.68 percent.