(Bloomberg) -- The Hungarian conglomerate controlled by Prime Minister Viktor Orban’s closest business ally sold the country’s biggest coal-fired power plant to the state in a U-turn after the premier agreed to the European Union‘s climate deal.

The transaction on Matrai Eromu plant, signed on Monday between Opus Global Nyrt. and state-owned energy group MVM Zrt., means that the projected $1 billion cost of making it environmentally sound will fall to taxpayers rather than the group of Lorinc Meszaros, a childhood friend of Orban and business partner of the prime minister’s family. The terms of the deal weren’t disclosed.

Orban, one of the last holdouts to the EU’s Green Deal, earlier this month signed up Hungary to the EU plan to eliminate net carbon emissions by 2050. That’ll entail an environmental overhaul for Matrai, the nation’s second-biggest power-generator after the Paks nuclear plant. The coal station, one of the country’s biggest polluters, has licenses to produce power via lignite through 2029.

The government plans to create a 500-megawatt gas-turbine plant fueled from renewable sources as well as a waste management block as the result of the planned overhaul. The cost is estimated at as much as 300 billion forint ($1 billion), MTI state news services reported on Friday, citing Innovation and Technology Minister Laszlo Palkovics. He said the project will be partly financed by EU funds and that the government wouldn’t raise electricity prices to cover the rest of the bill.

Opus -- the conglomerate whose businesses span energy, finance, construction and tourism -- bought a 73% stake in the Matrai last year. The plant posted its second consecutive annual loss in 2018, which didn’t stop shareholders from backing an 11.2 billion-forint payout in dividend after the 2018 business year.

Opus, in a statement, said it’s “thinking in the long term when it comes to energy” but would instead focus on renewables, power distribution and energy trading in the future.

To contact the reporter on this story: Zoltan Simon in Budapest at zsimon@bloomberg.net

To contact the editors responsible for this story: Balazs Penz at bpenz@bloomberg.net, Piotr Bujnicki, Andrew Reierson

©2019 Bloomberg L.P.