NEW YORK (AP) – Stocks ended an uneasy week mostly higher Friday, as a jury verdict against Merck & Co. over its painkiller Vioxx erased much of an earlier advance fueled by bargain hunting. The major indexes all suffered losses for the week.

Wall Street quickly pulled back late Friday after a Texas court found Merck liable for the death of a man who took Vioxx, and awarded his estate more than $250 million in damages. Merck shares dropped $2.31, or 7.6 percent, to $28.10 at the close of trading.

The overall market still managed a small gain as bargain hunters took advantage of recent declines and bought up underperforming stocks. Positive analyst reports on Coca-Cola Inc. and International Business Machines Corp., as well as indications of continued growth in China from Caterpillar Inc., also encouraged investors.

The advance also held despite a jump in crude oil futures, which rose on news of demonstrations in Ecuador that have disrupted oil exports. A barrel of light crude surged $2.08 to settle at $65.35 on the New York Mercantile Exchange.

According to preliminary calculations, the Dow Jones industrial average rose 4.30, or 0.04 percent, to close at 10,559.23.

Broader stock indicators finished mixed. The Standard & Poor’s 500 index gained 0.69, or 0.1 percent, to 1,219.71, while the Nasdaq composite index slipped 0.52, or 0.02 percent, to 2,135.56.

Bonds finished even despite stocks rising, with the yield on the 10-year Treasury note unchanged at 4.21 percent. The dollar was mixed against other major currencies, while gold prices inched lower.

Trading was expected to be volatile during Friday’s session due to the expiration of monthly futures contracts, which customarily prompts investors to make shifts in their holdings.

Wall Street has languished this month after rallying in July on strong corporate earnings and growth in the economy. Uncertainty about where the market is headed has had investors trading lightly as they grapple with the effects of soaring oil prices amid improved economic data and persistently low interest rates.

“I guess all things considered, the market’s been pretty impressive in the face of oil prices,” said Barry Berman, head trader at Robert W. Baird & Co. “It would appear that way looking at the fact that interest rates are still low on a relative basis. Lower rates are going to keep the economy going.”

Evidence of inflation brought on by higher energy costs pressured stocks for much of the week, especially after the government’s inflation reports showed big jumps in wholesale and consumer prices during July. This week, the Dow fell 0.39 percent, the S&P 500 lost 0.87 percent and the Nasdaq dropped 0.99 percent.

Dow component Coca-Cola fueled the mildly bullish sentiment early in Friday’s session. Analysts at UBS upgraded the stock to “buy” from “neutral,” citing the company’s stronger marketing efforts and improved sales forecasts. Coca-Cola gained 86 cents to $44.39.

IBM added $1.61 to $82.76 following a report from Prudential Securities that said the company is poised for a strong second half, when clients often increase spending. Prudential analysts also noted IBM is benefiting from layoffs and remains a better pick than rival Hewlett-Packard Co.

News of industrial growth in China lifted Caterpillar, another Dow component, which rose $1.67 to $54.82. The world’s top maker of heavy machinery said it signed three nonbinding deals with a government-affiliated industrial developer in China.

Autodesk Inc. climbed $2.06 to $40.41 after reporting second-quarter profits that nearly doubled from a year ago. The maker of engineering software credited a 33 percent jump in sales for the strong results, and raised its profit forecasts for the full year.

Despite posting a strong second quarter, Gap Inc. fed concerns about the retail sector after lowering its profit estimates for the year due to weaker sales. Gap beat quarterly profit expectations by 2 cents per share, but the fashion chain nonetheless fell 41 cents to finish at $19.74.

However, AnnTaylor Stores Corp. jumped $1.56, or 6.2 percent, to close at $26.60 even after the clothing retailer’s second-quarter profits fell from softer sales. The company nonetheless exceeded Wall Street’s expectations by a penny per share, and said improved margins would help it meet previously stated full-year profit targets.

Advancing issues outnumbered decliners by about 9 to 7 on the New York Stock Exchange, where preliminary consolidated volume came to 1.22 billion shares, compared with 1.4 billion traded at the same point on Thursday.

The Russell 2000 index of smaller companies rose 1.32, or 0.2 percent, to 652.51.

Overseas, Japan’s Nikkei stock average fell 0.13 percent. In afternoon trading, Britain’s FTSE 100 was up 0.82 percent, Germany’s DAX index surged 1.62 percent, and France’s CAC-40 rose 1.31 percent.

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.