The U.S. economy grew at its fastest clip in a year during late summer as consumers and businesses shrugged off fears of a new recession, according to government data released Thursday that helped drive the stock market to its best day since August.

Investors were also cheered by overnight news that European leaders have reached an agreement on how to address their continent’s debt crisis, and the Standard & Poor’s 500-stock index ended the day up 3.4 percent. European markets were up even more sharply, with the German Dax index up 5.3 percent.

The agreement in Europe still has many details to be filled in, and the 2.5 percent pace of U.S. economic expansion in the third quarter isn’t enough to bring unemployment down quickly, even if it is sustained. But on both sides of the Atlantic, the news on Thursday offered a sense of relief: Maybe the world isn’t falling apart after all.

“The Europeans told us they’re doing what they can do to take the immediate fear of fnancial collapse off the table, and the GDP numbers tell us that the U.S. economy did not collapse in the third quarter,” said Jerry Webman, chief economist at OppenheimerFunds. “Together they are a kind of sigh of relief.”

Owners of Greek debt will accept a reduction of as much as 50 percent in what they are owed, easing that country’s debt burden; banks will receive new capital; and a fund to back the continent’s governments will be enlarged fourfold, to $1.4 trillion. Analysts cautioned that executing the plan will require more difficult work by European governments in the months ahead.

Over the summer, uncertainty over Europe’s future and a downgrade of U.S. debt helped drive a period of confidence-rattling volatility in global financial markets. But now that the broadest measure of economic activity for that period is in, it appears that U.S. consumers and businesses took the events in stride.

Gross domestic product rose at a 2.5 percent annual pace in the July-through-September quarter, the Commerce Department said, considerably better than the 1.3 percent gain in the second quarter and the 0.9 percent rate of growth for the first half of 2011.

If there is to be a dip back into recession, as some analysts have feared, it appears it did not start in the third quarter.

But GDP was not strong enough to represent a “catch-up” effect that could bring the unemployment rate down substantially over time. Rather, 2.5 percent is somewhere around the treading-water rate of U.S. economic growth — the approximate rate of economic expansion that would be expected, given an ever-increasing labor force and rising worker productivity, but not enough to put many of the 14 million unemployed Americans back to work.

In another sign that the economy is not falling into recession, the number of new people filing claims for unemployment insurance benefits edged down last week, to 402,000 from a revised 404,000 the previous week.

Growth was bolstered during the quarter by a rebound in some of the areas that had held the economy back in the first half of the year. Automobile supply chains that had been disrupted by the Japanese earthquake in the spring reopened, and oil prices moderated after spiking early in the year.

The details of the new report on GDP — which aims to capture the value of goods and services produced within U.S. borders during the quarter — were generally more favorable than expected. Spending by American consumers rose at a 2.4 percent annual rate, better than analysts had forecast, suggesting that even as their confidence has been walloped, Americans continued going to stores.

But the ailing job market and stagnant incomes could weigh on consumer spending in the months ahead, and few analysts expect households to drive rapid growth anytime soon.

“The acceleration in consumer spending was driven by a drop in the saving rate, not by stronger income growth,” Nigel Gault, chief U.S. economist at IHS Global Insight, said in a report. “With employment growth weak, debt levels still high, consumer sentiment still very negative, and housing still bumping along the bottom, we can’t expect the consumer to be a strong driver of recovery.”

Business investment was a source of particular strength in the third quarter, as it has been for most of the past two years. Spending on equipment and software rose at a rate of 17.4 percent, and spending on structures such as office buildings and factories rose at rate of 13.3 percent.

A major question for the future will be whether the onset of a new wave of volatility and uncertainty in financial markets leads businesses to become more cautious in their capital spending plans in the final months of the year. At least through late summer, they were in expansion mode.

Business inventories, by contrast, subtracted 1.1 percentage points from GDP growth in the third quarter, which bodes well for the future. Businesses can’t slash their inventories indefinitely and may find a need to rebuild them, which means leaner inventories shouldn’t be an ongoing source of weakness. Final sales, which exclude inventories and which economists look to as a measure of underlying strength, rose at a 3.6 percent annual rate, suggesting some resilience in the economy.

Trade also aided growth, with exports rising at a 4 percent annual rate and imports rising more slowly, at a 1.9 percent rate.

One drag on growth, however, was government. Steep budget cuts by municipalities around the country led spending by state and local governments to fall at a 1.3 percent annual rate. State and local governments have subtracted from overall economic activity in 10 of the past 12 quarters.