Russia has said that nearly 1,000 Ukrainian troops at a giant steelworks in Mariupol have surrendered, abandoning their dogged defence of a site that has become a symbol of their country's resistance.

Ukraine ordered the fighters to save their lives - and said their mission to tie up Russian forces was now complete - but has not called the column of soldiers walking out of the plant a surrender.

The fighters face an uncertain fate, with Ukraine saying they hope for a prisoner swap but Russia vowing to try at least some of them for war crimes.

It is not clear how many fighters remain inside the stronghold, Ukraine's last in the strategic port city which is now largely reduced to rubble.

Both sides are trying to shape the narrative and extract propaganda victories from what has been one of the most important battles of the war.

Russian defence ministry spokesman Major General Igor Konashenkov said on Wednesday that 959 Ukrainian troops had now left the Avozstal plant since they started coming out on Monday.

At one point, officials put the number of fighters holed up in the mill's sprawling network of tunnels and bunkers at 2,000.

The figures, if confirmed, suggest that Moscow might be within touching distance of being able to claim that all of Mariupol has fallen. That would be a boost for Russian president Vladimir Putin in a war where many of his plans have gone awry.

But another setback already looms, with Sweden and Finland both officially applying to join Nato on Wednesday - a move driven by security concerns over the Russian invasion.

Mr Putin launched the invasion on February 24 in what he said was an effort to check Nato's expansion but has seen that strategy backfire.

Nato Secretary-General Jens Stoltenberg said he welcomed the applications, which now have to be weighed by 30 member countries.

Beyond its symbolic value, gaining full control of Mariupol would also allow Russia to deploy forces elsewhere in the Donbas, the eastern industrial heartland that the Kremlin is now bent on capturing.

It would also give Russia an unbroken land bridge to the Crimean Peninsula, which it seized from Ukraine in 2014, while depriving Ukraine of a vital port.

For months, the soldiers have defended the plant against the odds, but Ukraine's defence minister said on Tuesday that he had issued a new order to the fighters to "save their lives".

"Ukraine needs them. This is the main thing," Oleksiy Reznikov said.

What will now happen to the fighters is not clear. At least some have been taken to a former penal colony in territory controlled by Russian-backed separatists.

Ukraine says it hopes they can be exchanged for Russian prisoners of war and that negotiations are delicate and time-consuming.

But in Moscow, there are mounting calls for Ukrainian troops to be put on trial.

Russia's main federal investigative body said it intends to interrogate the troops to "identify the nationalists" and determine whether they were involved in crimes against civilians.

Also, Russia's top prosecutor asked the country's supreme court to designate Ukraine's Azov Regiment a terrorist organisation. The regiment has roots in the far-right.

The Russian parliament planned to take up a resolution on Wednesday to prevent the exchange of Azov Regiment fighters, Russian news agencies said.

Ukraine's deputy defence minister, Hanna Maliar, said negotiations for the fighters' release were ongoing, as were plans to pull out others still inside the mill.

Ukrainian president Volodymyr Zelensky said "the most influential international mediators are involved" in the evacuation.

Mariupol was targeted by Russia from the outset of the invasion. The city was largely flattened in steady bombardments, and Ukraine says over 20,000 civilians have been killed.

But the fighters in the steel plant held out, as the rest of the city fell to Russian occupation.

More than 260 Ukrainian fighters - some of them seriously wounded and taken out on stretchers - left the ruins of the Azovstal plant on Monday and turned themselves over to troops on the Russian side who patted them down and took them away on buses.

Others were taken way on Tuesday. Seven buses carrying an unknown number of Ukrainian soldiers were seen arriving at a former penal colony in the town of Olenivka, about 55 miles (88km) north of Mariupol.

If its capture is completed, Mariupol would be the biggest city to be taken by Moscow's forces.