U.S. economic growth picked up in the third quarter as stronger spending by consumers and the government offset falling exports and flat business investment, the Commerce Dept. said on Friday.

Growth in gross domestic product -- a measure of all goods and services produced within U.S. borders -- rose at a 2 percent annual rate in the third quarter, accelerating from the second quarter’s 1.3 percent pace and topping economists’ expectation of a 1.9 percent growth pace, but still too slow to speed up job creation and dent the unemployment rate. The report comes less than a week before the presidential election.

Consumer spending, which has the biggest impact on GDP,  increased to 2 percent from 1.5 percent in the third quarter, while government spending jumped 3.7 percent, the biggest increase since mid-2009. Meanwhile, investment in housing surged 14.4 percent.

Exports, which had risen 5.3 percent in the second quarter, declined 1.6 percent. Imports were also lower over the past three months. Business investment outside the residential sector fell 1.3 percent, the biggest drop since late 2009.