By Barani Krishnan

NEW YORK (Reuters) - Oil prices surged 5 percent on Tuesday, the biggest daily gain since April, as investors' covering of short positions and a technical rebound helped lift the market from two-month lows.

However, crude futures pared gains in post-settlement trade after industry group American Petroleum Institute (API) reported a surprise build of 2.2 million barrels in U.S. crude stockpiles last week.

During the regular trading session, a rally in global equity markets to record highs added to the upbeat sentiment in oil. The dollar fell, making greenback-denominated oil more attractive to holders of the euro and other currencies. [MKTS/GLOB] [.N] [USD/]

API also reported larger-than-expected gains in inventories of gasoline and distillates, which include diesel. A Reuters poll had forecast a crude drawdown of 3 million barrels last week, translating to an eighth straight week of declines. Official inventory data is due from the U.S. Energy Information Administration (EIA) on Wednesday. [EIA/S]

"It's another major curveball from the API in terms of expectations," said John Kildulff, partner at New York energy hedge fund Again Capital, referring to huge variances at times between the trade group's numbers and the government's.

"We'll just have to hunker down and wait for the EIA report."

U.S. crude's West Texas Intermediate (WTI) futures settled up $2.04, or 4.6 percent, at $46.80 a barrel. Brent crude futures settled up $2.22, or 4.8 percent, at $48.47.

After the API report, both benchmarks trimmed gains to less than $2 a barrel.

The robust rally in regular trading was the biggest in oil since April 8. It propelled the market from Monday's two-month lows when Brent tumbled to $45.90 and WTI $44.42.

"The market's gotten really short over the past two weeks with everyone focused on weaker fundamentals and now you're seeing sudden covering," said Scott Shelton, energy futures broker with ICAP in Durham, North Carolina.

Oil came under selling pressure after the last EIA weekly report contained U.S. crude and gasoline inventory numbers that signaled weak demand. A higher count for U.S. oil drilling rigs and fewer bullish bets by hedge funds had also weighed on the market. [RIG/U]

In Tuesday's early trade, oil was supported by producer group OPEC's optimism that the market was likely to achieve balance in supply-demand by next year. Also aiding sentiment was a separate EIA report showing higher estimates for U.S. oil demand growth in 2017. [OPEC/O]

(Additional reporting by Dmitry Zhdannikov, Ahmad Ghaddar and Christopher Johnson in LONDON and Henning Gloystein in SINGAPORE; Editing by Marguerita Choy and David Gregorio)