The economy picked up in the second quarter after a lackluster start to the year as solid consumer spending more than offset weak business stockpiling and residential investment.

The nation’s gross domestic product — the value of all goods and services produced in the U.S. — increased at a seasonally adjusted annual rate of 2.6%, the Commerce Department said Friday, in line with economists’ estimates.

The showing marked an improvement over the 1.2% growth pace recorded in the first quarter. Many economists, however shrugged off that performance, saying Commerce routinely underestimates growth early in the year because of challenges making seasonal adjustments in categories such as defense spending and exports.

Despite the bounce-back in the second quarter, the economy in the first half of the year grew at less than the tepid 2% pace that has prevailed throughout the eight-year-old economic recovery. President Trump has promised 3% growth but that hinges largely on congressional passage of his proposed tax cuts and infrastructure spending. That agenda has been pushed back and could be downsized because of investigations into Trump’s ties with Russia and hurdles to proposals to offset the lost tax revenue.

Consumer spending grew 2.8% in the second quarter, up from 1.2% the first three months of the year as Americans benefited from solid job and income growth as well as cheap gasoline. Also, delays in tax refunds were believed to have suppressed consumption early in the year but juiced outlays in later months.

Business investment increased 5.2%, down from 7.2% in the first quarter. Outlays on equipment surged 8.2%. The recovering oil sector has revived spending on pipes and related equipment over the past year. But some economists say investment along with business confidence if tax cuts are significantly delayed or watered-down.

But business stockpiling was a slight drag on growth after substantially adding to gains in the first quarter.