A ceasefire for east Ukraine has been agreed during talks in Minsk between Ukrainian government representatives and separatist leaders, according to news reports from the Belarusian capital.

The agreement came shortly after loud booms of artillery were audible in the city of Mariupol, which Kiev's forces are defending against a possible rebel onslaught.

The former Ukrainian president Leonid Kuchma began talks at a hotel in Minsk on Friday with leaders from the self-proclaimed Donetsk and Luhansk "republics", in the presence of officials from Russia and the Organisation for Security and Cooperation in Europe (OSCE).

Interfax reported that the ceasefire was due to come into effect at 6pm local time (1600 GMT). The official Twitter account of the Donetsk rebels said: "Representatives of the Donetsk People's Republic, the Luhansk People's Republic, and Ukraine have signed a ceasefire protocol."

Poroshenko had reportedly told the BBC on Friday he was "absolutely not confident" that any ceasefire would hold, but said he and Ukrainian forces were doing everything possible to achieve peace.

However, there was fighting on the ground near Mariupol, a strategic port city, as rebel forces allegedly backed by Russian army soldiers advanced down the coast from Novoazovsk, a city near the Russian border that was seized last week.

There had been heavy artillery fire overnight, though it was unclear whether the rebels wanted to push on to Mariupol before the peace talks started or were merely putting further pressure on Kiev to sign up to a peace plan dictated by Russian president Vladimir Putin.

After speaking to Poroshenko on Wednesday, Putin said he had jotted down the plan on a plane to Mongolia. It involves Ukrainian forces moving their artillery away from populated areas and political negotiations beginning. The deal would essentially freeze the conflict and will not be popular in much of Ukraine, but after an apparent injection of Russian troops and firepower over the past fortnight, pro-Ukraine forces have been routed and are on the retreat, meaning Poroshenko may be forced to sign the ceasefire.

It was not immediately clear whether the Ukrainian side had agreed to all elements of Putin's plan before signing the ceasefire.

The UK prime minister David Cameron, attending the summit of Nato leaders at Celtic Manor in south Wales, welcomed the ceasefire announcement, but said fresh sanctions against Russia would still go ahead. "The announcement about the ceasefire is good news," he said. "We need to look carefully at whether it is a ceasefire or whether it also includes a commitment, as I understand it might, to make real progress on a proper peace plan.

"We should be clear that the sanctions which we agreed last Saturday in Brussels will go ahead. But, of course, if a ceasefire and a proper peace plan are put in place, then it'll be right to look and see how those sanctions could potentially be removed if proper milestones are reached."

Cameron denied the west was accepting a de facto partition of Ukraine or that Moscow was set to "get away" with its aggression. "In that peace process we should be absolutely clear that we shouldn't accept the partition of Ukraine. It is one country whose borders should be respected.

"That is, I believe, what needs to happen now and I am confident that that is what President Poroshenko would seek to achieve."

As the Minsk talks got under way on Friday, there were several loud booms audible in Mariupol, loud enough to set off car alarms in the city centre. Ukrainian soldiers said they had not yet received any ceasefire orders.

Andriy Biletskiy, commander of the far-right Azov battalion, which has been doing much of the fighting, said the pro-Russia forces had been pushed back to 20km from the town, having reached 5km on Thursday night. He said his fighters did not suffer any casualties overnight, but there were reports of civilian deaths, including two children in the villages along the road.

Tanks and other armoured vehicles from the Ukrainian army arrived late on Thursday evening, Biletskiy said, and despite coming under heavy artillery fire, the Ukrainians were able to repel the rebel advance. Russian agencies reported that rebel armoured vehicles had entered the outskirts of Mariupol but there was no sign of this on the ground.

Biletskiy said he would obey the ceasefire order if it came but he hoped it would only be temporary: "What talk can there be of a ceasefire when the enemy is on our land?"

He also raised the possibility of volunteer fighters continuing a kind of partisan warfare to win back the regions: "As soldiers we will obey our orders but as citizens that will be hard to do."