* High crude output, refined product glut drag on prices

* Energy major Shell hit by low prices and profit margins

* Spain's Repsol bucks trend and raises profits

* Falling China rail freight points to weak economy

(Adds Shell, Repsol results, weak China data, updates prices)

By Henning Gloystein

SINGAPORE, July 28 (Reuters) - Oil prices came off early gains on Thursday and were close to April lows touched in the previous session as crude producers and fuel refiners continued to pump out more than the market can consume and economic growth prospects darkened.

Brent crude futures LCOc1 hit a high of $43.72 a barrel on Thursday but then fell to $43.47 at 0707 GMT, flat from their previous close. U.S. West Texas Intermediate (WTI) crude CLc1 was at $41.94, still up 2 cents from its last close but down from a high of $42.18 earlier in the day.

Brent and WTI hit their lowest since April in the previous session, at $43.27 and $41.68 per barrel, respectively, after U.S. government data revealed a surprise build in crude and gasoline inventories. The build adds to an already huge global refined product glut just as slowing economic growth dents the demand outlook for crude. urn:newsml:reuters.com:*:nL4N1AD2MC urn:newsml:reuters.com:*:nL4N1AB1BZ

"Oil prices were sold off heavily after the weekly EIA report showed a surprise build in crude oil inventory. The 1.7 million barrel increase (to 521.1 million barrels) was against market expectations of a 2.3 million fall. U.S. oil production also increased," ANZ bank said on Thursday.

"Oil remains weak, with the surprise build in US stocks likely to linger into today's trading," it added.

Oil markets have been dogged by oversupply for the last two years, which pulled down prices by as much as 70 percent between 2014 and early 2016, when Brent hit the lowest in more than a decade at around $27 per barrel.

Low oil prices and refining margins are hurting energy companies.

Energy major Royal Dutch Shell RDSa.L reported a more than 70 percent fall in quarterly profit on Thursday, well below analyst estimates, as weak oil and gas prices further ate into revenue.

Shell's net income came in at $1 billion in the second quarter, compared with analyst expectations of $2.2 billion and $3.8 billion achieved in the same period last year.

"Lower oil prices continue to be a significant challenge across the business, particularly in the upstream (business)," said Chief Executive Ben van Beurden.

Spain's Repsol REP.MC , however, managed to buck the trend and raised its net profit by 10 percent in the second quarter to 345 million euros ($382.50 million). urn:newsml:reuters.com:*:nL8N1AE1LH

Mihir Kapadia, CEO at wealth management firm Sun Global Investments, said that oil prices were still being depressed by concerns over a global supply glut and waning demand from key international markets.

In China, rail freight volume fell 7.5 percent in the first half of 2016 from the same period a year earlier to 1.58 billion tonnes, the country's top economic planner said on Thursday. ($1 = 0.9020 euros)

(Reporting by Henning Gloystein; Editing by Richard Pullin and Subhranshu Sahu) ((henning.gloystein@thomsonreuters.com, +65 6870 3263, Reuters Messaging: henning.gloystein.thomsonreuters.com@reuters.net;))

Keywords: GLOBAL OIL/