The U.S. economy slowed to a moderate 2.3 percent annual growth rate in the first quarter as consumer spending turned in the weakest performance in nearly five years.

Still, the January-March increase was better than expected and was enough to propel growth over the past year to come close to the 3 percent goal set by the Trump administration.

The Commerce Department says the gain in the gross domestic product, the economy's total output of goods and services, followed a 2.9 percent rise in the fourth quarter and gains above 3 percent in the previous two quarters. It was the strongest nine-month stretch in a decade.

Economists had been forecasting a first quarter slowdown. They expect growth to surpass 3 percent in the current quarter.