MOSCOW—Russia has withdrawn key defense advisers from Venezuela, an embarrassment for President Nicolás Maduro as Moscow weighs the leader’s political and economic resilience against growing U.S. pressure.

Russian state defense contractor Rostec, which has trained Venezuelan troops and advised on securing arms contracts, has cut its staff in Venezuela to just a few dozen from about 1,000 at the height of cooperation between Moscow and Caracas several years ago, said a person close to the Russian defense ministry.

The gradual pullout, which has escalated over the past several months, according to people familiar with the situation, is due to a lack of new contracts and the acceptance that Mr. Maduro’s regime no longer has the cash to continue to pay for other Rostec services associated with past contracts.

Russia has been among Mr. Maduro’s biggest international supporters, but the winding down of Rostec’s presence shows the limits of Russia’s reach in the South American country at a time when Moscow is facing economic difficulties—in part due to the impact of U.S. sanctions—at home. Venezuela has been one of Moscow’s largest customers in South America.

Rostec’s withdrawal of permanent and temporary employees is a major setback for Mr. Maduro, who has frequently touted assistance support from Russia and China as a sign that other global powers are willing to assist him in his bitter standoff against the U.S. Russian military support has been central to Mr. Maduro’s pledge to defend Venezuela from any foreign invasion.