High volatility marked the week, with the S&P 500 falling 2.3 percent on Monday in its worst day since November 7, which fueled talk that the market's long-awaited pullback had arrived.
Friday's trading volume, at 6.4 billion, was the lowest of the week, but in line with the average for the year. Much of Boston, a major U.S. financial center and home to a number of the country's biggest mutual fund companies, was under virtual lockdown as police killed one suspect in the Boston Marathon bombing in a shootout and mounted house-to-house searches for a second man, reports Reuters.
For the week, the S&P 500 ended down 2.1 percent but the index managed a finish above its 50-day moving average after ending below that level on Thursday for the first time this year.
Boosting the S&P 500 on Friday were shares of Google, which gained 4.4 percent to $799.87 a day after posting upbeat results. At least six brokerage firms have raised their target on Google's stock price.
The Dow finished barely in positive territory, held back by shares of International Business Machines (IBM.N), which posted their largest drop in eight years after the company's quarterly results missed estimates. IBM's stock ended down 8.3 percent at $190.
"Unless there's a shock to the system, investors will move back into the market as we head through earnings season, but now investors have an opportunity to study the winners and losers more closely," said Michael Sheldon, chief market strategist at RDM Financial in Westport, Connecticut.
The Dow Jones industrial average .DJI rose 10.37 points, or 0.07 percent, to 14,547.51 at the close. The Standard & Poor's 500 Index .SPX gained 13.64 points, or 0.88 percent, to finish at 1,555.25. The Nasdaq Composite Index .IXIC rose 39.69 points, or 1.25 percent, to close at 3,206.06.
For the week, the Dow slid 2.1 percent, while the Nasdaq lost 2.7 percent. Markets were roiled earlier in the week by the plunge in gold prices and slower growth out of China, the world's second-largest economy.
Still, the S&P 500 remains up about 9 percent for the year, and analysts said the pullback could give investors a chance to reevaluate their bets.
Options volume began the day unusually light for expiration day, which is typically a heavily traded session, as traders focused on developments in Boston. But trading in options picked up as the day progressed and ended near average levels.
The Boston situation "does disrupt activity. If you're a financial adviser, you're probably not having meetings today. But in terms of a corporate entity, most of the big ones in the city are probably operating pretty normally," said John Canally, investment strategist and economist at the Boston office of LPL Financial, which is the nation's largest independent broker-dealer.
On last month's expiration day, overall volume spiked to 8.6 billion shares traded, the busiest day of the year so far, but expiry days in January and February had volume of just 6.7 billion to 6.8 billion shares.
Among other tech gainers, shares of Microsoft MSFT. jumped 3.4 percent to $29.77 and topped the Nasdaq's most-active list after the company reported quarterly revenue and earnings that exceeded Wall Street's expectations.
Shares of Boeing Co (BA.N) gained 2.1 percent to $87.96 after U.S. regulators approved a revamped battery system for its 787 Dreamliner. The jet was grounded in January because the plane's lithium-ion batteries overheated.
Less-than-stellar earnings from McDonald's (MCD.N) and General Electric (GE.N) also weighed on the blue chips.
GE shares fell 4.1 percent to $21.75 after the conglomerate reported a quarterly profit in line with expectations as GE sold more jet engines and shed its stake in NBC Universal. The stock topped the New York Stock Exchange's list of most actively traded names.
McDonald's stock lost 2 percent to $99.92 after the world's biggest fast-food chain reported a first-quarter profit that fell short of Wall Street's expectations and said sales at established U.S. restaurants fell 1.2 percent.
Friday's volume totaled 6.4 billion shares traded on the New York Stock Exchange, the Nasdaq and the NYSE MKT, in line with the average daily closing volume of 6.4 billion this year.
Advancers outnumbered decliners on the New York Stock Exchange by a ratio of about 11 to 4, while on the Nasdaq, nearly 17 stocks rose for every eight that fell.