(Reuters) - Hedge funds betting on summer gasoline demand raised their bullish bets on U.S. crude futures this week, just before the market's crash on Friday on Britain's shock decision to leave the European Union, trade data showed.

Money managers, including hedge funds and other big speculators, boosted their combined net longs in U.S. crude futures and options in both New York and London by 18,000 contracts to 216,003 contracts in the week to June 21, data from the U.S. Commodity Futures Trading Commission (CFTC) showed.

It was the first rise in three weeks in net longs held by the group as U.S. crude's benchmark West Texas Intermediate (WTI) futures began to rise toward the psychological $50 a barrel mark after choppy trades the previous fortnight.

But the higher price wagers appeared ill-timed given WTI's 5 percent plunge on Friday to settle at $47.64 after the unexpected British exit, or Brexit, from the EU. The drop was the largest in a day since February.

"It couldn't have been worse luck for the managed money crowd that the market tanked the same week it decided to build on its longs," said John Kilduff, partner at New York energy hedge fund Again Capital.

"Still, I think there's significant appetite out to build on new longs, with U.S. gasoline demand near decade-highs and supply-demand imbalances continuing to tighten." [EIA/S]

Oil has had difficulty staying above $50 since it crossed that barrier in late May. Much of the skepticism has been on whether supply outages that propelled prices since February have made a big enough dent on a global crude glut.

Prices have also been rangebound on worries that U.S. crude output will increase again if prices rise above $50. The U.S. oil rig count finally dropped this week after rising in three previous weeks. [RIG/U]

Some analysts think Friday's rout could be the precursor to a larger oil selloff that could derail the market's three-month long recovery.

"Higher risk aversion is likely to make it hard for prices to regain the $50 per barrel mark in anything like the near future," said Carsten Fritsch, analyst at Frankfurt's Commerzbank.

Others disagreed.

"The current move to the downside in oil prices comes at a time when the oil complex was overbought and the fundamental picture was in the midst of indicating that the global market is rebalancing," said Dominick Chirichella, senior partner at the Energy Management Institute in New York.

"Unless there are clear signs that the system is breaking down, a stabilization move is likely to occur in the short term."

(Reporting by Barani Krishnan; Editing by Chizu Nomiyama)