By Corrie Driebusch and Christopher Whittall

U.S. stocks fell Friday, ending a week dominated by quarterly earnings reports.

For the week, the S&P 500 fell 0.7% and the Nasdaq Composite dropped 1.3%, while the Dow Jones Industrial Average rose 0.1%. The weekly losses coincided with a selloff in government bonds.

On Friday, stocks pulled back from earlier gains after the Federal Bureau of Investigation said it was reviewing new evidence in connection with its investigation of Democratic presidential candidate Hillary Clinton's email server.

Some of the initial selling was likely triggered by algorithmic tradingplatforms that analyze news headlines for certain words or phrases, mark them as negative or positive, and buy and sell stocks or bonds accordingly, some traders said.

The S&P 500 was up 0.2% shortly before the news, then quickly reversed those gains and ended down 0.3%. The yield on 10-year U.S. Treasury note fell to 1.834%, according to Tradeweb, before bouncing back to 1.847% -- its highest yield since May 27.

The price of gold jumped after falling earlier in the day. Gold for November delivery gained 0.6% to $1,275.50.

Investors and traders have been nervous in recent weeks ahead of the U.S. presidential election, making the market susceptible to shifts in expectations about who will win.

"The next week before the election will keep the market on edge," said Kenny Polcari, director of equities at O'Neil Securities, adding that he expects more surprises that could swing stocks.

Earlier Friday, stocks were risingafter the Commerce Department said gross domestic product expanded at an inflation- and seasonally adjusted 2.9% annual rate in the third quarter, exceeding the second quarter's pace of 1.4%.

The improved U.S. economic data helped offset several weaker-than-expected quarterly results from U.S. companies, capping a busy week for corporate earnings reports. More than half of S&P 500 companies have reported so far.

McKesson shares tumbled 23% after the health-care giant cut its profit outlook for the year. Amgen shares fell 9.6% as the drugmaker reported a drop in sales of its cancer-care drug Neupogen, which started facing competition late last year.

Health-care stocks in the S&P 500 fell 2.2%.

Shares in Amazon.com fell 5.2% after the online retail giant late Thursday posted its lowest quarterly profit in a year.

Despite Friday's declines, so far the earnings season is shaping up to be better than downbeat expectations.

"Overall, the mini earnings recession is coming to an end," said Chris Jeffery, an asset-allocation strategist at Legal & General Investment Management. "That's largely about the energy and materials sectors coming out of their slump," he added.

Anheuser-Busch InBev, the world's largest brewer, cut its revenue forecast, sending its shares down 4.3% in Europe. The Stoxx Europe 600 slipped 0.3%, losing 1% for the week.

Japan's Nikkei Stock Average rose 0.6% Friday and 1.5% for the week.

Write to Corrie Driebusch at corrie.driebusch@wsj.com and Christopher Whittall at christopher.whittall@wsj.com

(END) Dow Jones Newswires

October 28, 2016 16:55 ET (20:55 GMT)

Copyright (c) 2016 Dow Jones & Company, Inc.