In this town deep in eastern Ukraine's rebel heartland, about a quarter of the population works in the coal mines owned by billionaire Rinat Akhmetov, Ukraine's richest man. Here and elsewhere in territory controlled by the separatist insurgency, the tycoon keeps the lights on and people clothed and fed, with a mixture of jobs, electricity and aid.

At the same time, Akhmetov operates factories on the other side of the frontline, powering Ukraine's economy and pouring hundreds of millions in taxes into government coffers. His steel products, which are finished in rebel territory, are then shipped to the West — where they bring in billions in revenue for Akhmetov that then indirectly props up the separatist government.

The billionaire is able to straddle the frontline by using his fortune and business empire as leverage. His companies provide more than 300,000 jobs across Ukraine, most in the rebel-held east. Meanwhile, his control over utilities that provide electricity and heating to both sides allow him to dictate terms to the government as well as the rebels. Cracking down on Akhmetov's factories in government territory would threaten Ukraine's depressed economy, while a collapse of utilities in the east would undermine the rebels' grip on power.

It makes for a striking picture of economic cooperation between enemy areas: Coal produced in Krasnodon mines, on rebel territory, travels to the Avdiivka coking plant on the government side. Coke is then shipped back to rebel lands, to a metals smelter in Yenakieve, and the metals produced there are transported to government territory on the Azov Sea — for shipping to the West.

Meanwhile, Western purchases, which account for the most of Akhmetov's profits, are helping to keep the rebel territory afloat by fueling economic activity. Akhmetov's Metinvest metals and mining holding posted revenues of $1.8 billion in the first quarter of the year, a 6 percent increase over the previous year, with Europe accounting for 35 percent of sales and North America for 3 percent. Steel works in rebel-controlled Yenakiyeve accounted for a quarter of the company's steel output in the first quarter.

After separatist leaders occupied parts of the Donetsk and Luhansk regions, the Ukrainian government said anything that is produced there should be classified as contraband. But Kiev gave the green light for Akhmetov's empire — which stretches from coal mines and metal smelters to power plants — to trade with the rebel-held areas and export its products just as it did before the war.

When the insurgency erupted in 2014, the Ukrainian government set about shutting down Ukrainian businesses in the east, and most private businessmen fled. The war has killed more than 8,000 people, but also erected barriers between suppliers and customers. Only Akhmetov — worth $6.7 billion according to Forbes magazine — has been allowed to operate on both sides.

Neither Akhmetov nor the rebels acknowledge that he is propping up the separatists. But there is little doubt that his factories, and the back-and-forth of trade over the frontline, are critical to the rebel regime. Admitting any cooperation with the rebels would be the end for the 48-year-old billionaire: His company would be in violation of international law and shut out of Western markets.

Metinvest and Krasnodonugol, Akhmetov's coal company, say they pay no taxes to the rebel government or directly finance the separatists.

"We tell them that right now we cannot comply with the demands that the (Luhansk separatist) republic is putting forward because complying with them would mean the enterprise would have to shut down," Krasnodonugol director Alexander Angelovsky told The Associated Press.

Earlier in the conflict, Krasnodonugol came under attack from the rebels, a mine employee told The AP. Its director was briefly arrested, and a separatist fighter with a live grenade in his hands stormed into a meeting room, threatening to blow up the place unless the rebels were allowed to take a firing position on the grounds. Now residents in the separatist areas speak about a sense of order, installed by Russians, which has replaced the chaos and anarchy of the first months of the separatist movement.

When asked about cooperation with separatist leaders, Angelovsky said he does not deal with fighters but rather with "new official bodies" made up of the same officials who were in charge under the Ukrainian government. The only difference, he said, is that they have "raised the new flag."

A few blocks away from Krasnodonugol, the office of the former Ukrainian tax inspection now handles rebel taxes. Staff would not comment publicly, but a senior official, who was not authorized to speak to the media, said every business in town, about half of the 4,000 that were here before the war, is now registered to pay rebel taxes. Asked about Krasnodonugol, he chuckled and said: "We are working on it."

Enrique Menendez, a well-connected Donetsk businessman who closed his advertising firm to launch a humanitarian effort, does not believe Akhmetov is supporting the rebels in any direct way. But it's clear, he said, that the insurgents need Akhmetov, who is originally from the east but now lives in Kiev.

"It's one thing when you wag a finger and vow to fight an oligarch regime," Menendez said of the rebels. "It's another thing if you decide to declare war on (Akhmetov). If he shuts down his energy assets now, ahead of the heating season, what are they going to do?"

Akhmetov is also the largest provider of humanitarian aid in rebel territory, since the separatists will not allow Ukrainian government aid, and Western organizations are having difficulties delivering their own.

The tycoon's Shakhtar FC arena, which hosted the 2012 European football championships, now serves as a warehouse for the relief effort. Last winter, when Ukraine suspended pensions and benefits to those living in rebel-held areas, and before the rebels began paying their own benefits, food packages delivered to the Shakhtar arena helped the city's poorest residents survive. Akhmetov's charity fund says it has now given away more than 4.3 million food packages.

In Donetsk, the capital of the insurgency, Akhmetov is not just a businessman but a father figure. When a methane blast killed 33 miners at the Zasyadko coal mine in March, he offered to pay compensation to the injured and to the families of the dead, even though he did not own the mine.

For its part, Ukraine is dependent on Akhmetov for taxes, power generation and the coal mined in rebel lands. His energy company DTEK provides half of all coal produced in Ukraine and runs three giant power plants on separatist-held territory.

Akhmetov's holding company, System Capital Management, told The AP by email that it "will continue to operate in the territory of sovereign Ukraine where is possible to do so, despite the operational challenges, and we applaud the hard work and loyalty of our employees who have continued to work in these tough conditions to ensure that business and essential services such as electricity continue to be delivered, despite hardship and risk." Like Metinvest and Krasnodonugol, the company denied allegations that it may be paying taxes to anyone other than the Ukrainian government.

Radical Ukrainian politicians tend to call everyone operating in the separatist area a collaborator — and many are calling vociferously for a stop to Akhmetov's operations in the east. The reality is much more complicated: Most big companies in the region are registered to pay taxes to Kiev, with more than 90,000 companies and 150,000 individuals in rebel-held areas — including Akhmetov's — registering anew this year to do so, according to Roman Nasirov, chief of the Ukrainian Fiscal Service.

Authorities, however, cannot help but suspect them of paying off the rebels: "We realize that in reality they have to pay some fees in the occupied areas," Nasirov said. "You may call them taxes or extortion money."

Meanwhile, Akhmetov's privileged status does not make him immune from the effects of the war, or restrictions imposed by Ukraine.

Five of Akhmetov's mines in Krasnodon had to stand idle from January to June as they waited for a permit to transport coal to their main client, the coking plant in Avdiivka, on the government side.

Earlier this month, rebel leaders threatened to suspend all coal supplies to the rest of Ukraine. Akhmetov's DTEK energy company, however, said this week that it still sends coal to Ukrainian power stations; and Krasnodonugol told AP that it is still selling coal to eastern and central Ukraine.

The Avdiivka operations are also feeling the brunt of the war. On a recent visit to the Avdiivka plant, electricity workers were busy repairing power lines cut down by the previous night's shelling, which is nearly a daily occurrence.

Ironically, the shells fly in from Krasnodon area which supplies Avdiivka much of its coal.