WASHINGTON — Optimism about the job market lifted U.S. consumer sentiment in April to its second-highest level since 2007.

The University of Michigan’s sentiment index rose to 95.9 from 93 in March. Only January’s reading of 98.1 has been higher since 2007, the year the Great Recession began. Over the past five months, sentiment has been, on average, at its highest level since 2004.

Richard Curtin, chief economist of the Michigan survey, attributed the April increase to optimism over consistently low inflation and low interest rates and improving prospects for jobs and incomes.

Curtin said consumers expect interest rates to rise from current historically low levels but only modestly. And they expect any economic damage from higher rates to be offset by the benefits of more jobs and incomes.

Since March 2014, the U.S. economy has produced a healthy 3.1 million job gains. The government said Wednesday that the economy grew at an annual rate of just 0.2 percent from January through March. But economists expect growth to strengthen in the spring.

“Consumers appear to be shrugging off recently disappointing economic data and stock market choppiness,” said Jim Baird, chief investment officer for Plante Moran Financial Advisors. “Despite evidence that the economy slowed considerably in the first quarter, sentiment remains relatively high and suggests that the important consumer spending engine isn’t at risk of stalling.”