Stocks lost gains in the final hour of trading on Friday as investors looked ahead to next week's presidential election.

The S&P 500 was up 0.09%, the Dow Jones Industrial Average fell 0.03%, and the Nasdaq was flat. The S&P 500 fell for its eighth session in a row on Thursday.

Current polls indicate Democratic presidential candidate Hillary Clinton has a slight advantage in battleground states and a wider path to winning the electoral college over Republican presidential candidate Donald Trump. Stocks have teetered throughout the week as Trump gained a few points in national polls. Voters will head to the polls next Tuesday, Nov. 8.

The number of jobs added to the U.S. economy came in slightly lower than expected, though August and September numbers were both revised upward. Economists anticipated 171,000 jobs to have been added to nonfarm payrolls in October.

The unemployment rate slipped to 4.9% from 5%, as expected. Average hourly earnings rose 0.4%, the highest since July, and above consensus of 0.3% growth. Earnings rose 2.8% year over year, highest since 2009.

"Today's report is the first of two employment reports we will get ahead of the December FOMC meeting," BNP Paribas analysts wrote in a note. "If this labor market progress continues, we see a high likelihood of a 25bp hike at that meeting, barring other shocks. Following the November FOMC statement we bumped up our probability of a December hike to 75% and today's NFP print nudges it higher to 80%."

The chance of a rate hike in December currently sits at 72%, according to CME Group fed funds futures. The Federal Reserve opted to leave rates unchanged at its November meeting, though members noted that the case for a hike had strengthened.

The Fed will make gradual rate hikes over the next two years, Atlanta Fed President Dennis Lockhart said in a speech. Lockhart said he expects the economy to grow around 2% next year.

The U.S. trade deficit declined 9.9% in September to $36.4 billion, its lowest level since early 2015. Exports increased 0.6%, while imports fell 1.3%.

Crude oil prices held lower on Friday after the oil-drilling activity in the U.S. climbed over the past week. The number of active oil-drilling rigs increased by 9 to 450, according to Baker Hughes data.

Prices were already in decline on reports Saudi Arabia could increase production as a freeze agreement among the Organization of Petroleum Exporting Countries fell apart. Crude closed at its lowest level in six weeks on skepticism any deal from OPEC could come from a meeting in Vienna later this month.

West Texas Intermediate crude closed 1.3% lower at $44.07 a barrel on Friday.

Starbucks (SBUX) - Get Report climbed more than 2% after topping quarterly estimates on its top- and bottom-lines. The coffee chain earned 56 cents a share, a penny over expectations. Revenue jumped 16.3% to $5.71 billion, besting consensus by $30 million.

Starbucks said overall same-store sales in the quarter rose 4% for the second straight three-month period, but came in below Wall Street estimates for a 4.8% increase. Starbucks also boosted its quarterly dividend by 25% to 25 cents a share.

Starbucks is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells SBUX? Learn more now.

CBS (CBS) - Get Report rose 3% after besting sales and profit estimates over its third quarter. The television network earned an adjusted $1.05 a share, 7 cents above estimates, on revenue of $3.4 billion. Analysts had expected $100 million less in revenue.

CEO Leslie Moonves also commented on the prospect of reuniting with Viacom (VIAB) - Get Report , saying that "if it looks right and is structured properly, it could be an exciting opportunity." Moonves said talks are still in their very early stages.

GoPro (GPRO) - Get Report slumped 4% after a weak third quarter and disappointing guidance for its fourth quarter and full year. An adjusted net loss of 60 cents a share compared with consensus of a loss of 35 cents a share. Sales slumped nearly 40% to $240.6 million, missing estimates of $313.4 million. The action camera maker anticipates fourth-quarter earnings no higher than 35 cents a share, missing consensus of 43 cents.

FireEye (FEYE) - Get Report climbed 16% after reporting a far-narrower loss than expected thanks to cost-cutting measures. The cybersecurity developer reported an adjusted loss of 18 cents a share, narrower than consensus of a loss of 31 cents. The company announced job cuts three months ago.

Whole Foods (WFM) jumped 3% before being halted for volatility. Rumors swirled that a major shareholder could push for changes.

CenturyLink (CTL) - Get Report rose 1% after selling its data centers in a billion-dollar deal to fund its purchase of Level 3 Communications (LVLT) . The communications company sold the assets to BC Partners for $2.15 billion in cash in a transaction that should close in the first quarter on next year. CenturyLink's $25 billion acquisition of Level 3 was announced earlier this week.