Hiring was surprisingly strong in October, while the unemployment rate ticked higher, according to a report released just four days before the presidential election.

The economy added 171,000 jobs in October, and unemployment inched up to 7.9%, from 7.8% in September, the Labor Department said Friday.

Obama's economy View photos A look at where the economy stood when Obama took office and what's changed since.

Economists surveyed by CNNMoney had expected employers to add 125,000 positions, so the boost in hiring was mostly seen as a positive surprise.

Superstorm Sandy, which devastated the northeastern part of the U.S. this week, had no impact on the report since the survey was taken earlier in the month, the Labor Department said.

Another good sign was that job growth in recent months was even stronger than originally reported. The number of positions added in August and September were revised sharply higher, adding a combined 84,000 more jobs than first thought.

"We are again seeing a quickening in the rate of hiring," said Heather Boushey, senior economist at the left-leaning Center for American Progress. "It's moving in the right direction."

However, the pace of hiring has not regained the force it had in January and February, when more than 250,000 jobs were added each month.

The rise in unemployment was expected by economists, and was mainly because more people joined the labor force. Some economists believe that September's drop in unemployment encouraged those out of work to reenter the labor force.

Related: Check the unemployment rate in your state

The job gains were spread across varying industries, with the entire private sector adding 184,000 people to the payroll. Professional and business services added 51,000 positions, while health care employment rose by 31,000. The construction sector continued to bring on employees, adding 17,000 jobs last month. Retail and leisure and hospitality also boosted payrolls.

But government employers took a step back, shedding 13,000 jobs after several strong months of gains. Manufacturing was little changed and mining lost 9,000 jobs.

Wages remained essentially flat for all employees.

"A few more people are working, but they are not making any more," said Keith Hembre, chief economist at Nuveen Asset Management.

Related: Best Jobs in America

The report, the last before Tuesday's election, will likely be picked apart by politicians as well as economists. September's report, which showed an unexpected drop in the unemployment rate, prompted an outcry from Republican supporters, including Jack Welch, claiming the figure had been manipulated.

The monthly jobs report has taken on increased importance as the nation struggles to recover from the economic downturn. Roughly 12.3 million people remain unemployed, 40.6% of whom have been so for more than six months. And presidential candidates Barack Obama and Mitt Romney are centering much of the campaigns on who can create more jobs.

Obama touted the rosy report on the campaign trail Friday, noting that employers have picked up hiring lately.

"This morning we learned that companies hired more workers in October than at any time in the last eight months," he said in Ohio.

Romney, meanwhile, swiftly issued a statement saying the report was "a sad reminder that the economy is at a virtual standstill." He noted the jobless rate is higher than it was when Obama took office. In January 2009, the unemployment rate was 7.8%.

While many industries are adding jobs, the current tepid pace of growth is not enough to climb out of the jobs hole, economists said. Companies remain hesitant to boost payrolls. One of their main worries? How the president and Congress deal with the looming fiscal cliff.

"The broader economy is still just limping along," said Bill Dunkelberg, chief economist for the National Federation of Independent Business. "We don't really see any major pickup in job growth."