By Timothy Puko 

The amount of rigs drilling for oil in the U.S. rose for the first time in seven months, triggering a slump in crude oil prices to their lowest settlement in two months.

U.S. oil producers added 12 rigs last week, breaking 29 straight weeks of cuts, in response to prices that have rebound to- and stayed at $60 a barrel since late April. That convinced producers to end months of massive cutbacks that started after the U.S. shale drilling boom flooded the market and sent prices crashing.

But the increase in rigs is scaring investors and analysts who have warned that oil could be on the verge of another sharp fall. Production has kept making small gains even as drilling has declined and stockpiles have hit historic levels around the world. If rigs get back to work, that could keep the market flooded with oil, a concern that built strong momentum this week.

On Wednesday, the U.S. benchmark price broke below a $4 range it had traded in for two months. That jolt came after the U.S. Energy Information Administration reported domestic oil stockpiles unexpectedly rose for the first time in nine weeks.

Those drilling-rig cuts have slowed dramatically in recent weeks, and last week's increase is a sign the market may stay oversupplied and head for a "replay" of the past year's steep fall in prices, said John Kilduff, founding partner of Again Capital in New York, which invests in energy commodities.

"It seems to be a definitive break in the trend and it's definitely registering in the market," he added. "The rig count's going up, but the production, after all the past cuts, isn't going down either. This is a week of very bearish news for the oil market."

On Thursday, the U.S. benchmark price fell 3 cents, or 0.1%, to $56.93 a barrel on the New York Mercantile Exchange. The losses are small, but came after crude rose as high as $57.97 late Thursday morning.

U.S. oil lost 4.5% on the week, its largest one-week decline since early March. Its settlement was the lowest since April 22.

Brent, the global benchmark also pared Thursday's gains back to 6 cents, or 0.1%, to $62.07a barrel on ICE Futures Europe.

Oil prices fell by more than half from last summer, and drilling followed, with about 60% fewer rigs working since a peak of 1,609 in October. Oil prices rebounded in the early spring, but many analysts and investors say the price rebound was based largely on speculation that the cutbacks in working rigs would lead to declines in production.

Pioneer Natural Resources Co. is among several U.S. shale producers that said they would begin ramping up after seeing the price of oil stay at or near $60 a barrel for several weeks. Pioneer is in the process of adding two rigs in the Permian Basin in Texas and the company plans to add two rigs a month through March 2016, a spokesman said.

"Any bump up in prices and they start putting straws in the ground," said Tim Rudderow, president of Mount Lucas Management, which oversees $1.7 billion. Mr. Rudderow had said last week he was skeptical oil production would slow like many bulls are expecting and that he was trading options that would pay off with a slow decline in crude futures.

Crude stocks remain near levels not seen for this time of year in at least the last 80 years, the EIA said.

Negotiations over the Iranian nuclear deal continue to drag on the market as well, after the West and Tehran extended their self-imposed deadline earlier this week. A final agreement to curb Iran's nuclear program is expected to pave the way for the lifting of Western sanctions and release more Iranian crude on the global market.

"We are going into the second half of this year with a heavily oversupplied fundamental picture, which makes any bullish price forecast hard to accept," David Hufton of PVM brokerage said.

In refined products, gasoline ended up 2.75 cents, or 1.4%, at $2.0343 a gallon on the Nymex, while diesel gained 0.06 cent, or 0.03%, to $1.8399 a gallon.

Georgi Kantchev, Angela Chen and Erin Ailworth contributed to this article.

Write to Timothy Puko at tim.puko@wsj.com