As Noam pointed out earlier, government spending played a big part in limiting the decline in GDP last quarter -- and it was largely a result of automatic stabilizers like unemployment insurance and rising defense spending rather than the stimulus package.
The WSJ's Jon Hilsenrath goes a bit further to argue that defense spending played the biggest role in government spending, so "Beware of politicians and economists who credit fiscal stimulus for slowing the pace of recession in the second quarter." In terms of contribution to GDP, defense spending added 0.67% while nondefense spending added 0.15% and state and local spending added 0.30%.
But by far the biggest contributor to GDP on the plus side was imports (or more accurately, a drop in imports, which by GDP math counts as positive for growth). This chart from James Hamilton highlights the contribution of imports to GDP during the worst parts of the recession:
In fact, declining imports are a pretty reliable, and perhaps "unsung," automatic stabilizer. This chart shows the percentage contribution to GDP from imports since 1980. In every recession (shown in gray), GDP growth has gotten a boost from the drop-off in demand for foreign goods and services:
Also worth highlighting is the jaw-dropping collapse in residential fixed investment (which basically captures spending on the construction of new single- and multi-family homes and spending on home improvements):
The chart shows the index level of real residential fixed investment going back to 1980. The level of spending last quarter was 57 percent lower than the peak in the fourth quarter of 2005 and is on par with spending for the category back in 1991. It's pretty rare to see collapses like this in aggregate data, especially when they've been adjusted for inflation.
--Zubin Jelveh