WASHINGTON (AP) — U.S. worker productivity rose 3 percent in the third quarter, the best showing in three years, while labor costs fell for a second straight quarter.

The increase in productivity in the July-September quarter was double the 1.5 percent gain in the second quarter and both quarters were up significantly from a scant 0.1 percent rise in the first three months of the year. Labor costs fell 0.2 percent after an even bigger 1.2 percent decline in the second quarter.

The third quarter figure for productivity was unchanged from an initial estimate while labor costs were initially estimated to have risen by 0.5 percent.

Economists are hopeful that the upturn in productivity may be a sign that this key measure of living standards is improving after a prolonged period of weakness.

Economists believe finding ways to increase productivity, the amount of output per hour of work, is the biggest challenge facing the economy right now. They say that without an improvement, the Trump administration will have difficulty reaching its goal of doubling economic growth in coming years.

The upturn in the past two quarters reflects the fact that overall output, as measured by the gross domestic product, accelerated sharply following a weak start to the year. GDP grew at an annual rate of 3.3 percent in the third quarter, the government reported last week, and that followed a 3.1 percent rise in the second quarter. It was the first back-to-back GDP gains of 3 percent or better in three years.

Productivity actually declined in 2016, dropping 0.1 percent. It was the first annual decline in 34 years and followed a string of weak annual performances since the economy emerged from recession in mid-2009.

Productivity has averaged annual gains of just 1.2 percent from 2007 through 2016, a sharp slowdown from average annual gains of 2.6 percent from 2000 to 20007. Those increases reflected a boost from the increased use of computers and the internet in the workplace.