Russia has informed the U.S. that it has pulled most of its military personnel out of Venezuela, U.S. President Donald Trump said Monday.

The Moscow action is a setback for Venezuela's socialist President Nicolas Maduro. He has clung to power with the support of Russia and China, but more than 50 countries, including the U.S., have recognized National Assembly president Juan Guaido as Venezuela's legitimate leader.

Russian state defense contractor Rostec, which had trained Venezuelan troops and advised on securing arms contracts, has sharply cut its staff in Venezuela, from about 1,000 personnel a few years ago at the height of cooperation between Moscow and Caracas, to a few dozen, according to a Wall Street Journal report Sunday that quoted a defense ministry source.

FILE - Russian President Vladimir Putin speaks during a news conference in Sochi, Russia, May 15, 2019.

The newspaper said the pullout of the Rostec personnel escalated in the last several months with the lack of new contracts and the realization that the crisis-ridden Maduro government no longer has enough money to pay for services tied to past Rostec contracts.

Trump, on a state visit to Britain, announced the Russian pullback in a Twitter comment.

A month ago, U.S. officials spoke publicly about what they felt was the impending overthrow of Maduro as tens of thousands of people protested against his government in the streets of Caracas. But military support for Maduro held steady, except for a small number of defections to Guaido, leaving Maduro in power.