Oil prices climbed for a seventh straight session in thin trading on Friday, posting their longest bull run since April, but still turned in their worst first-half performance since 1998.
Lingering worries about oversupply have knocked 16 percent off Brent crude so far this year, despite a deal involving OPEC members and some other major producers to curb production.
On Friday, oilfield services firm Baker Hughes reported its weekly count of oil rigs operating in U.S. fields fell for the first time since January. It was down by two oil rigs to a total of 756.
U.S. crude futures ended Friday's session $1.11 higher, up 2.5 percent, at $46.04 a barrel, having added 7 percent this week. Benchmark Brent climbed 48 cents to $47.90 a barrel by 2:38 p.m. ET (1838 GMT) and has gained 5 percent this week.
Trading volume was low ahead of the U.S. Independence Day holiday weekend.
Brent and U.S. crude fell about 19 percent in the first half of 1998. Oil prices have generally increased in first half of most years.
On Friday, Chinese government data showed factories grew at the quickest pace in three months, according to the Purchasing Manager's Index.
"Good PMI data from China certainly gives you hope that demand is growing globally," said Rob Haworth, senior investment strategist at U.S. Bank Wealth Management.
Crude hit a 10-month low last week as rises in output revived concerns about global oversupply. But data this week showing a temporary dip in U.S. oil production has dented the bearish sentiment.
U.S. crude output dropped 100,000 barrels per day (bpd) to 9.3 million bpd last week, the steepest weekly fall since July 2016.
Meanwhile, the North Sea crude oil market is finally showing signs of long-lost strength.
On Thursday, about 6 million barrels of North Sea Brent crude were being stored on ships, down from four-month highs of 9 million last week. Trading sources said it seemed refineries were now starting to take in more cargoes.
That suggests some of the pessimism that has driven down oil futures this month and boosted bets against a price rise may be unjustified.
In recent weeks, funds have been unloading long speculative positions, reducing bets on higher prices, while brokerages including Goldman Sachs and Societe Generale have cut their 2017 forecasts for crude prices.
Reuters' monthly oil price poll also showed analysts have reduced their price forecasts again, with 2017 average Brent and WTI prices lowered by more than $2 since last month.
Bank of America Merrill Lynch analysts cut their forecasts on Friday, saying the rise in output from Libya, Nigeria and U.S. shale fields coupled with weaker demand growth, meant the market would be more oversupplied than previously expected.
Global oil supplies remain ample despite output cuts of 1.8 million bpd by the Organization of the Petroleum Exporting Countries and other producers since January.
The oil market shrugged off news that production from Libya, one of two OPEC members exempt from the group's supply deal, had soared above 1 million barrels per day (bpd).
The U.S. dollar fell to its lowest since October in early trading on Friday, giving investors an incentive to buy dollar-denominated commodities such as crude oil.