NEW YORK/LONDON (Reuters) - Oil prices hit six-month highs on Monday on worries about global supply outages and as long-time bear Goldman Sachs sounded more positive on the market, although a stockpile build at the U.S. storage hub for crude futures limited gains.

Expectations of resumption in oil exports from a Libyan port, a ramp up in Nigerian crude production by Exxon Mobil Corp and an improved oil-for-loans deal reached by Venezuela with China furthered the tempered the bullish theme in oil.

Brent crude futures settled up $1.14, or 2.4 percent, at $48.97 per barrel. It rallied to $49.47 earlier, its highest since early November, in a test towards $50.

U.S. crude’s West Texas Intermediate (WTI) futures rose by $1.51, or 3.3 percent, to end at $47.72 after touching a six-month high at $47.85. WTI saw a flurry of late buying, with more than 13,600 lots changing hands in the final minute, according to Reuters data, in an attempt to test $48.

Crude futures have rallied for most of the past two weeks from a combination of Nigerian, Venezuelan and other outages, declining U.S. production and virtually frozen inflows of Canadian crude after wildfires in Alberta’s oil sands region.

The disruptions triggered a U-turn in the outlook for the oil market from Goldman Sachs, which had long warned of global storage hitting capacity and of another oil price crash to as low as $20 per barrel.

“The oil market has gone from nearing storage saturation to being in deficit much earlier than we expected,” said Goldman, which added that supply likely shifted into a deficit in May.

But some of Monday’s bullish sentiment took a back seat when market intelligence firm Genscape reported a stockpile build of 694,176 barrels at the Cushing, Oklahoma delivery point for WTI futures. The build surprised some market participants expecting a stock decline in Cushing due to the shuttered Canadian output.

Elsewhere, Exxon Mobil was expected to ramp up its production of Nigeria’s Qua Iboe crude while Libya’s port of Hariga was slated to resume blocked crude shipments.

Venezuela also reached a deal with China to improve conditions in an oil-for-loans deal that gives the OPEC member breathing room ahead of heavy debt payment.

While Goldman sounded more positive on the market than before, it also cautioned that at around $50 a barrel, supply could flip back into a surplus in the first half of 2017 if exploration and production activity picked up.