CARACAS, Venezuela — The Russian state-controlled oil firm Rosneft said Saturday it was ceasing operations in Venezuela and selling all of its assets in the country, signaling a shift in Kremlin strategy that could further rattle Venezuela’s crumbling economy.

Rosneft had emerged as the biggest economic ally of Venezuela’s authoritarian president, Nicolás Maduro, accounting for up to two-thirds of the country’s oil trade and a significant share of crude production. The lifeline provided by Rosneft has allowed Mr. Maduro to maintain a flow of hard currency and supply the country with gasoline.

The United States imposed sanctions this year on two Rosneft oil trading subsidiaries for helping Mr. Maduro. The sanctions, which have hurt the company’s business elsewhere in the world, were cited by a Rosneft spokesman Saturday in describing the sale.

Still, the sale of Rosneft’s assets is not necessarily a move away from Mr. Maduro by Russia, one of the country’s few foreign backers.