By Maria Tsvetkova and Noah Barkin
DONETSK Ukraine/BERLIN (Reuters) - A gun battle broke out in the center of the rebel-held Ukrainian city of Donetsk and residents ran for cover from artillery fire on Tuesday, taking a government military offensive into the heart of the retreating pro-Moscow separatist rebellion.
Russian President Vladimir Putin and his Ukrainian counterpart will meet next week for the first time in months to try to end their confrontation over the separatist rebellion in eastern Ukraine, their offices said.
In a prelude to the talks between Putin and Ukraine's Petro Poroshenko, German Chancellor Angela Merkel is to visit the Ukrainian capital Kiev on Saturday, her office said, to show support for the Ukrainian government.
A diplomatic solution would have to resolve a contradiction: with his troops advancing and victory possibly within reach, Poroshenko has little incentive to offer the kind of compromises that would allow Putin to achieve a face-saving deal.
Donetsk has for months been the headquarters of Ukraine's separatist rebellion, with rebel flags flying over administrative buildings and where residents strolled along the main avenue lined with flower bed and fountains.
On Tuesday afternoon, the center of the city was transformed into a battle zone.
A Reuters reporter said intense shooting broke out. Five or six rebel gunmen ran through a shopping mall car park, ducking behind cars and firing their guns.
It was not possible to determine at whom they were firing; there was no sign of Ukrainian troops and the rebels remained in control of the center.
In a park near the rebel headquarters building, residents fled when they heard the sound of shelling nearby. Shops closed early, and cars with gunmen inside sped through the streets, ignoring red traffic signals.
A few hours earlier, fighting broke out in Makiyivka, a neighborhood on the eastern edge of Donetsk that until Tuesday had not seen any combat.
A resident of Makiyivka who gave his name as Svyatoslav said he had seen separatist fighters turning back an ambulance from the scene of the fighting, telling the crew there was no one left alive for them to treat.
"They're having to retreat, they're not able to stand their ground the way they want to," he said of the rebels.
Ukrainian officials said their troops were also fighting rebels in the center of the other big separatist stronghold, the city of Luhansk, on the border with Russia.
The conflict, which began when street protests put a Western-leading leadership in power in Kiev against Moscow's wishes, has dragged relations between Russia and the West to their worst level since the end of the Cold War.
It has also triggered a round of trade sanctions and retaliatory measures which are hurting fragile economies both in Russia and in European Union states.
Russia annexed the Ukrainian region of Crimea earlier this year. Since then, Kiev and its Western backers say Russia has been arming the anti-Kiev rebellion in Russian-speaking eastern Ukraine, an allegation that Moscow has denied.
The offices of the Ukrainian and Russian presidents said both men would attend a meeting in the Belarus capital, Minsk, on Aug. 26, which is also to be attended by EU officials, and the leaders of Belarus and Kazakhstan.
Officially, the meeting concerns relations between the EU and a customs union involving Russia, Belarus and Kazakhstan, but Ukraine will top the agenda.
The meeting will be the first between Putin and Poroshenko since a fleeting encounter in Normandy, France, in June at commemorations of the World War Two D-day landings.
European officials say privately that they will keep up pressure on Putin to not support the rebels, but at the same time Ukraine has to be persuaded not to ruthlessly press home its advantage on the battlefield.
That could humiliate the Kremlin and force it into an unpredictable reaction, officials say.
Stefan Meister of the Berlin-based German Council on Foreign Relations said Merkel would use her visit to Kiev to back Poroshenko, but also to test how flexible Kiev is willing to be to achieve a deal with Moscow.
"In order to get a compromise with Russia, you need movement from Ukraine. How prepared are they to do that at a time when they are on the offensive in the east, trying to establish facts on the ground?" said Meister.
"I have the feeling Putin may be ready to talk but he can't lose face."
Russian officials welcomed any European moves to bring Kiev - which they blame for what they call a humanitarian disaster in eastern Ukraine - to the negotiating table in earnest.
A senior Russian foreign ministry official, who spoke on condition of anonymity, said: "We welcome any movement, any understanding by the West, especially Germany, that the situation cannot be resolved without solving the problem inside Ukraine, in the same way that pressure on Russia did not and does not make any sense."
The fighting in eastern Ukraine has taken a heavy human toll. The United Nations says an estimated 2,086 people, including civilians and combatants, have been killed in the four-month conflict.
That figure nearly doubled since the end of July, when Ukrainian forces stepped up their offensive and fighting started in urban areas.
In Donetsk, artillery fire has struck apartment buildings, killing and wounding residents. Officials in Kiev deny they are firing heavy weapons at residential areas.
A doctor at a maternity hospital showed Reuters a ward that she had set up in a cellar, for use when the shelling makes it too dangerous for mothers to give birth above ground.
Luhansk has been largely cut off for weeks and is now in its 17th day without water and regular supplies of electricity which have hit mobile and landline phone connections.
A statement issued by the press service of the Luhansk municipality painted a picture of misery and fear for inhabitants there.
"Overnight there was fresh shelling. The center of the town has seriously suffered particularly near the central market ... As a result of the armed clashes civilians have been wounded and killed. There is further destruction (of buildings)," it said.
Fires had broken out in several places after shelling. Only vital foodstuffs were on sale. "Bread is being sold from vehicles, with big queues forming ... Interrupted supplies of food, medicines and fuel to Luhansk is a particularly acute problem," the statement said.
Some of the people who fled the fighting crossed the border into Russia and were gathered at a refugee camp near the Russian village of Donetsk.
Roman Dubchak, 40, a coal miner from east Ukraine, said he fled with seven of his family members, including his disabled father and three children.
"We have nothing left: no job, no cash and no accommodation. We are heading nowhere," he said at the refugee camp, sitting near a tent. "Our (mine) shaft was destroyed by a combat aircraft, our village no longer exists."
(Additional reporting by Thomas Grove in Donetsk, Ukraine, Natalia Zinets, Richard Balmforth and Alessandra Prentice in Kiev, Alexei Anishchuk in Moscow and Dmitry Madorsky in Donetsk, Russia; Writing by Christian Lowe; Editing by Giles Elgood)