German energy giant RWE said on Monday it is on track to hit the upper targets of its 2017 forecast after a huge nuclear tax refund powered a strong second quarter performance.

The Essen-based group said net profit rose to 1.72 billion euros ($2 billion) from April to June, compared to a net loss of 403 million euros over the same period a year earlier.

Revenues fell by two percent to just over 10 billion euros, it said in a statement.

"RWE is on track. According to our current planning, we should finish the fiscal year towards the upper end of our forecast ranges," chief executive Rolf Martin Schmitz said.

The group said it was boosted by the German high court's decision in June that a government-imposed nuclear fuel tax was illegal, paving the way for billions of euros in refunds for energy firms.

RWE said the windfall helped reduce its net debt to 21.5 billion euros, down 1.2 billion on the figure recorded at the end of 2016.

Strong performances by the group's energy trading unit, gas-fired plants and renewables spin-off Innogy contributed to the optimism for 2017, the group said.

Looking at the first half of the year RWE said its adjusted underlying, or operating, profit stood at 3.2 billion euros, putting it on course to meet the higher end of its forecast of a full-year operating profit of 5.4 to 5.7 billion euros.

The group said it also remained confident of adjusted net profits of between 1.0 and 1.3 billion euros for 2017, compared with 800 million in 2016.

"We made the right decisions," Schmitz said.

Alongside the ordinary dividend of 0.50 cents per share for 2017, the group announced that it plans to pay a special dividend of 1 euro per share over the nuclear fuel refund.

The tax, which levied 145 euros per gramme of new radioactive fuel, had netted the German government nearly 6.3 billion euros from 2011-2016, according to finance ministry data.

RWE has said that the tax has cost it 1.7 billion euros.

Like other big energy firms, RWE has grappled with low wholesale electricity prices in recent years.

As the owner of Europe's largest stable of coal-fired power plants it has also been especially vulnerable to subsidised competition from renewables.

RWE has responded to the challenges by spinning off its renewables and power grid businesses under a new subsidiary, Innogy, while keeping its coal, gas and nuclear plants within the original company structure.