MOSCOW, April 22 (Reuters) - Russia announced on Thursday it was ordering troops back to base from the area near the border with Ukraine, apparently calling an end to a buildup of tens of thousands of soldiers that had alarmed the West.

The currencies of both Russia and Ukraine rose sharply after the announcement, signalling relief among investors just hours after Russia also ended war games in Crimea, the peninsula it occupied and annexed from Ukraine in 2014.

A confirmed pullout of the troops brought in on top of the permanent contingent will likely be welcomed by Western countries that had been expressing alarm at the prospect of further Russian intervention in eastern Ukraine. Russian-backed separatists have been fighting the Ukrainian government in the region since 2014.

The Ukrainian president’s spokeswoman said this month that Russia had more than 40,000 troops deployed on Ukraine’s eastern border and over 40,000 in Crimea. Around 50,000 of them were new deployments, she said. Moscow has not provided any troop numbers.

In a tweet, President Volodymyr Zelenskiy said Ukraine "welcomes any steps to decrease the military presence & deescalate the situation in Donbas (eastern Ukraine)", adding "Grateful to international partners for their support".

Foreign Minister Dmytro Kuleba had told Reuters Kyiv did not know whether Moscow intended to launch an attack or not, and said the West must make clear it would stand with Ukraine if Russia did so.

"So it can go in either direction now," Kuleba said. "And this is why the reaction of the West, the consolidated reaction of the West, is so important now, to prevent Putin ... from making that decision."

U.S. State Department spokesman Ned Price said Washington was aware of Russia's announcement and was watching the situation on the border closely. "We've heard words. I think what we'll be looking for is action," Price said.

Russian Defence Minister Sergei Shoigu said he had ordered troops involved in exercises to return to their bases by May 1, as they had completed what he called an "inspection" in the border area.

"I believe the objectives of the snap inspection have been fully achieved. The troops have demonstrated their ability to provide a credible defence for the country," Shoigu said.