Oil prices closed 2 percent higher after a volatile session on Thursday, with investors less worried about prospects for the global economy after the last pre-vote opinion polls showed Britain was likely to remain in the European Union.
Oil prices were also supported by market intelligence firm Genscape's report of a drawdown of nearly 1 million barrels at the Cushing, Oklahoma storage base for U.S. crude futures during the week to June 21, traders who saw the data said.
Brent crude settled up $1.03, or 2.1 percent, at $50.91 a barrel. U.S. crude settled at $50.11 a barrel, up 98 cents. Both contracts shot up in the last few minutes of trading.
Commodities and other financial markets have been on tenterhooks ahead of Britain's referendum on EU membership. Most results are expected between 0100 and 0300 GMT, with a YouGov exit poll soon after voting closes at 2100 GMT.
The dollar index was down 0.2 percent. While the sterling's rally to 2016 highs weighed on the dollar, lower U.S. jobless claims limited the greenback's drop as the data bolstered the outlook for the American economy and chances for a rate hike. A weaker dollar makes greenback-denominated oil more attractive to users of other currencies.
While oil trended higher, intraday moves were choppy over speculation on how the British vote would go.
"If the outcome turns out to be 'Remain', the global market reactions are likely to be muted," said Dominick Chirichella, senior partner at the Energy Management Institute in New York.
"A 'Leave' outcome would present the largest risk to global risk asset market values as this is not the outcome the market is currently expecting."
In oil market news, the Canadian Association of Petroleum Producers cut its 2030 Canadian oil output forecast by 400,000 barrels per day (bpd) to 4.9 million bpd.
Nordic bank SEB lifted its 2016 Brent crude oil estimate to $48 a barrel, up from $44 previously, and raised its 2017 price forecast to $55 a barrel from $50.
Saudi Arabia's energy minister said in a Saudi television interview that oil prices were improving and supply and demand had almost balanced.
(By Barani Krishnan; Additional reporting by Devika Krishna Kumar and Karolin Schaps; Editing by David Gregorio and Chris Reese)