U.S. crude ended at a 2-1/2 year high on Wednesday as Palestinian rocket strikes on Israel escalated Middle East geopolitical risks and U.S. gasoline inventories posted the biggest seasonal decline on record.

Brent crude fell, narrowing its premium to U.S. oil futures, as part of a wave of profit-taking on the spread between the two contracts which has jumped to record highs this year due to bulging inventories in the U.S. Midwest.

U.S. trading activity was 45 percent below the 30-day average -- the sixth day in a row it has traded below that level -- as investors weighed the escalating tensions in the Middle East and North Africa that have cut crude supplies and the crisis in Japan that has muddled the demand outlook for the world's No. 3 oil consumer.

U.S. crude futures for May delivery settled at $105.75 a barrel, gaining 78 cents and marking the highest close since September 2008. Volumes reached only 476,156 contracts near the end of the trading day, on track for the lowest level since January 3.

In London, Brent May crude futures pared losses and settled down 15 cents at $115.55, after hitting the day's high of $116.40, edging close to its 2-1/2 year high near $120 posted late in February. Brent trade volumes were also low, nearing 285,000 lots late Wednesday, 46 percent lower than the 30-day average.

U.S. oil's gains narrowed its discount to Brent crude to below $10 a barrel, after ending on Tuesday near $11.

The rockets that hit Israel helped rally crude, said Daniel Flynn, analyst at PFGBest Research in Chicago. I have seen some unwinding of the Brent/WTI spread, people taking profits.

As U.S. crude approached its 2011 high of $106.95 a barrel, it was showing signs of being overbought on a key technical indicator. It was threatening to breach the 70 level on the 14-day relative strength index, which is usually interpreted by technicians as a sign a reversal lower is imminent.

U.S. gasoline futures settled 1.68 cents higher at $3.0213 a gallon.

U.S. GASOLINE INVENTORY DROP

U.S. oil was boosted by data from the U.S. Energy Information Administration which confirmed a late Tuesday report from the American Petroleum Institute showing a steep drop in gasoline inventories for the week to March 18.

Gasoline stockpiles in the first three weeks of March have shown the steepest decline for the period on records stretching back to 1990, as refiners shed stockpiles of winter grade gasoline ahead of the shift to summer grades.

Refinery runs rose by 0.7 percentage points, however, while crude inventories showed a stronger-than-expected build.

MIDEAST UNREST

While traders say the market has already priced in an extended loss of Libyan crude due to violence in the OPEC nation, markets are eyeing unrest throughout the Middle East for signs of potential disruptions from other big oil producers.

Palestinian rockets fired from Gaza slammed into two cities deep in Israel while a deadly suitcase bomb exploded in Jerusalem, reigniting violence between Israelis and Palestinians.

In top OPEC exporter Saudi Arabia, authorities arrested 100 Shi'ite protesters in demonstrations in the east of the country last week, a Saudi human rights group said, while in neighboring Bahrain, 30 people were wounded in the state's crackdown against demonstrators demanding democratic reforms.

Western warplanes silenced Muammar Gaddafi's artillery and tanks besieging the rebel-held town of Misrata, while in Sanaa Yemen's president offered to step down by the end of the year in a bid to appease protesters seeking his ouster.

(Additional reporting by Robert Gibbons and Matthew Robinson in New York; Ikuko Kurahone in London and Alejandro Barbajosa in Singapore; editing by Marguerita Choy and Jim Marshall)