The Ukrainian flag fluttered over the regional headquarters of Mariupol on Friday after government forces reclaimed the port city from pro-Russian separatists in heavy fighting and said they had regained control of a long stretch of the border with Russia.
The advances are significant victories for the pro-European leadership in a military operation to crush the armed rebellion, which began in east Ukraine in April, and hold the former Soviet republic of 45 million together.
In central Mariupol, police cordoned off several streets, where roadblocks of sandbags and concrete blocks, once manned by rebels, were riddled with bullet-holes and the burnt-out hulk of an armoured personnel carrier with rebel insignia smouldered.
"At 10:34 a.m. the Ukrainian flag was raised over City Hall in Mariupol," Interior Minister Arsen Avakov wrote on Facebook, less than six hours after the attack began on the city of 500,000, Ukraine's biggest Azov Sea port.
A ministry aide said the government forces stormed the rebels after they were surrounded and given 10 minutes to surrender. At least five separatists and two servicemen were killed in the battle before many of the rebels fled.
A group of around 100 Mariupol citizens, who had gathered in the town centre to show their opposition to the government's actions, exchanged obscenities and crude gestures with Ukrainian soldiers, who were driving through town in a column of armoured trucks.
"The government brought everything here, including a cannon... people were not allowed to come and witness how the government was shooting its own citizens," 52-year-old Andrei Nikodimovich said.
Mariupol, which has changed hands several times in weeks of conflict, is strategically important because it lies on major roads from the southeastern border with Russia into the rest of Ukraine and steel is exported through the port.
Regaining control of the long and winding frontier is also vital for the government because it accuses Moscow of allowing the rebels to bring tanks, other armoured vehicles and guns across the porous border.
Avakov said the government forces had won back control of a 120-km (75-mile) stretch of the border that had fallen to the rebels, but it was unclear who controlled other parts of the some 2,000-km frontier.
Ukrainian gas compromise
The rebels rose up in the Russian-speaking east and southeast after Russia annexed Crimea in March following the overthrow of Moscow-leaning President Viktor Yanukovich, who had triggered protests by spurning trade and political pacts that would have deepened ties with the European Union.
The new president, Petro Poroshenko, intensified the military operation against the rebels after he was elected on May 25 but is also trying to win support for a peace plan.
On Friday a separatist leader Denis Pushilin said he was potentially open to the idea of talks provided there were mediators present, including Russia.
"If an international organisation were also involved that would be a plus too," he said in an interview on Russian television.
Poroshenko's aides say progress has been made at initial meetings with a Russian envoy and that any immediate threat of a Russian invasion has receded.
Moreover, Ukraine said on Friday it was ready to pay a compromise price of $326 per 1,000 cubic metres for Russian natural gas to avert the threat of Moscow cutting off supplies and allow time to reach a long-term pricing agreement.
Moscow demanded $485 per 1,000 cubic metres at the start of the negotiations - European customers last year paid Gazprom $387 per 1,000 cubic metres - before a discount of $100 per 1,000 cubic metres.
The sides have disagreed over how much Ukraine should pay for its gas, and Russian state gas exporter Gazprom has threatened to turn off the taps to Kiev if it does not start paying billions of dollars in debts by Monday. This could disrupt supplies to the European Union as it gets about half its gas imports from Russia, half of them via Ukraine.
Political ties have also been strained by the appearance of several tanks in east Ukraine. Avakov accused Russia on Thursday of allowing the rebels to bring them across the border and Poroshenko told Russian President Vladimir Putin by phone that the situation was "unacceptable."
Evidence that Russia is directly assisting the rebels militarily would implicate Moscow in the uprising, making a mockery of its denials of a role in the fighting.
Russia did not immediately respond to the accusations and it was not clear how Putin reacted to Poroshenko by phone.