Analysts who were predicting a sharp downturn in the nation’s gross domestic product in the second quarter of the year due to earlier dismal economic news got a surprise with the release of a new report.

The U.S. Commerce Department says this measure of the total output of the nation’s goods and services increased at an annual rate of 2.5%, up from a first reported 1.7% increase a month ago.

The new figure is also more than double the number reported during the first quarter, when it moved higher by a 1.1% annual rate. The report is the second of three quarterly reports the department will issue.

Part of the reason for the better performance is that the United States exported more goods and imported less, while consumer spending during the period increased at an annual rate of 1.8%.

The report also showed all money earned by consumers, businesses and governments increased at an annual rate of 2.5% while corporate spending increased at a rate of nearly 10%.

In contrast, overall government spending fell at a rate 0.9%, twice the rate than first reported, while spending by the federal government contracted at an annual rate of 1.6%.

The falloff in federal spending is likely the result of the budget sequester that kicked in earlier in the year, while increased spending by consumers reflects better feelings they have about the economy and job prospects.

This news follows a separate report on Monday from the private group The Conference Board showing its Consumer Confidence Index, increased slightly in August from the month before, following in a slight drop in July.

“Consumers were moderately more upbeat about business, job and earning prospects,” said Lynn Franco, director of economic indicators at The Conference Board. “In fact, income expectations, which had declined sharply earlier this year with the payroll tax hike, have rebounded to their highest level in two and a half years. Consumers’ assessment of current business and labor market conditions, on the other hand, was somewhat less favorable than last month.”