NEW YORK (Reuters) - Oil prices closed up on Friday after a rally in prices on geopolitical instability in Iraqi Kurdistan helped Brent make its strongest third-quarter price performance since 2004.

An oil well pump jack is seen at an oil field supply yard near Denver, Colorado, U.S., February 2, 2015. REUTERS/Rick Wilking/File Photo

Global benchmark Brent crude LCOc1 closed up 13 cents or 0.2 percent to $57.54 a barrel, notching up a third-quarter gain of around 20 percent. On the week, Brent was up 1.2 percent.

The contract reached its highest in more than two years earlier in the week, resulting in a fifth consecutive weekly gain. This was Brent’s longest weekly bull run since June 2016.

U.S. crude CLc1 closed up 11 cents to settle at $51.67 a barrel, its strongest third quarter in 10 years and longest streak of weekly gains since January. U.S. crude was up around 2 percent on the week.

“The bigger concern for oil is the Kurdish region,” said Matt Smith, director of Commodity Research at ClipperData. “Today we’re seeing international flights banned, the trucking of fuels being banned from Iran.”

Iraq’s Kurds endorsed secession by nine to one in a referendum on Monday that has angered Turkey, the central government in Baghdad and other powers, which fear the vote could lead to renewed conflict in the oil-rich region.

Turkish President Tayyip Erdogan called the vote illegitimate and has threatened to break with past practice and deal only with the Baghdad government over oil exports from Iraq.

Oil price gains have also been supported by anticipated demand from U.S. refiners resuming operations after shutdowns due to Hurricane Harvey.

But oil output from the Organization of Petroleum Exporting Countries has risen this month by 50,000 barrels per day (bpd), a Reuters survey found, as Iraqi exports increased and production edged higher in Libya, one of the producers exempt from a supply-cutting deal.

Middle Eastern oil producers are concerned the recent price rise will incentivize U.S. shale production and push prices lower again.

U.S. energy companies added oil rigs for the first week in seven after a 14-month drilling recovery stalled in August, energy services firm Baker Hughes said on Friday. Drillers added six oil rigs in the week to Sept. 29, bringing the total count up to 750.

Money managers raised their net long U.S. crude futures and options positions in the week to September 26, the Commodity Futures Trading Commission said Friday. The speculator group raise its futures and options position in New York and London by 55,623 contracts to 285,555.