Ukraine said Monday it was in talks with Moscow over the return of 311 Ukrainian soldiers and border guards who had been forced by fighting with separatists to cross into Russia, but Russian border authorities said the troops were seeking asylum.

Both sides seemed set to use the fate of the troops to score propaganda points as Ukrainian government forces extended steady gains it has made against the pro-Russian separatists since a Malaysian airliner was downed over a rebel-held area on July 17.

Ukrainian defense spokesman Andriy Lysenko said a group of soldiers and border guards, who had been caught between the Russian border to the east and rebel positions in the west, had crossed into Russia in the early hours of Monday.

He put their number at 311, telling a news briefing they had retreated into Russia for safety reasons after helping their comrades break through rebel lines.

Kiev, he said, was now negotiating with Russian authorities for their return.

In Moscow, authorities acknowledged that Ukrainian troops had crossed into Russian territory — though they put the number at 438 — and Russian border guards said they had crossed during the night seeking asylum.

"They were tired of the war and wanted no further part in it," Vasily Malayev, spokesman for the border guards in the Rostov region of Russia, said by telephone. However, he added that 180 would be returned to Ukraine later Monday.

Russian Foreign Minister Sergey Lavrov, speaking to Itar-Tass and Rossiya24 TV, said Russia would facilitate the return of the Ukrainian soldiers but suggested they would be vulnerable to prosecution for desertion once they returned home.

"I expect Ukrainian authorities to understand that it is absolutely unacceptable, when Ukrainians . . . are forced to fight with their own people, to treat those who refuse to do so as traitors to the motherland," Lavrov said.