US crude settles up $1.21, at $51.69 a barrel

Getty Images

Oil rallied again on Friday, with benchmark Brent crude on track for its largest two-week gain in 17 years, as falling oil rig counts and violence in producer Libya helped to further stall a selloff that began in June.

Crude prices have rallied nearly 20 percent over the past six sessions, but remain about 50 percent below their peak from the middle of last year, due to worries of a global oil glut.

U.S. crude closed $1.21 higher, at $51.69 a barrel. The contract rose 7.2 percent for the week, it's biggest weekly gain since February 2011.

Meanwhile was up about $1 at $58 a barrel on Friday.

Brent futures were headed for about a 10 percent gain on the week, the biggest increase since 2011, and 19 percent over two weeks, the largest since 1998.

Still, the price rebound has come at the expense of sharp market volatility.

Low oil prices possible short-term: Pro
Low oil prices possible short-term: Pro

U.S. crude oil futures have seen daily gyrations of up to 9 percent since last week as bulls and bears squared off positions on mixed signals the market could remain oversupplied through the first half while falling rig counts and reduced exploration budgets of oil firms suggested the glut may be overcome faster.

The worldwide count for oil drilling rigs fell by 261 in January, oil services firm Baker Hughes said. The average number of U.S. oil rigs, meanwhile, fell by 199 in January, following the largest weekly drop since 1987a decline of 90 rigsin the week to Jan 23.

Read MoreOil heading for $30, currency war coming: Analysts

Baker Hughes reported on Friday the count came down by another 87 rigs last week.

"People have only started playing attention to the oil rig count in the past week despite the fact they have been falling for weeks," said Gene McGillian, analyst at Tradition Energy in Stamford, Connecticut. "I think the people really benefiting from these market gyrations are the high frequency traders as volumes are really up."

The two-week volume in Brent was at a record high of about 3 million contracts, Reuters data showed.

Read More Crude oil volatility indicates a bottom: Traders

Aside from the rig count data, the market was bolstered by fighting across Libya.

Fighting across Libya, where two governments and parliaments allied to rival armed groups are vying for control, highlighted the threat of a breakup in the country, imperiling the country's oil exports.

Stronger-than-expected U.S. jobs growth in January helped as well, though the data also raised expectations that a U.S. rate hike may happen as soon as mid-year.

U.S. non-farm payroll data showed firm job growth in the world's largest oil consumer in January,a positive signal for demand. The United States added 257,000 jobs last month. Analysts had expected a rise of 234,000.