MOSCOW — The Russian government announced Wednesday that it will sell nearly 20 percent of its state oil company, Rosneft, to the Swiss commodity trading firm Glencore and the sovereign wealth fund of Qatar.
The deal defies expectations that no investor would dare buy a share in the Russian asset, given Western sanctions against the government of President Vladimir V. Putin.
But the emergence of foreign money suggests that investors are reassessing the sanctions after the election of Donald J. Trump, who has advocated warming ties with authorities in Moscow and is considering the chairman of Exxon Mobil, Rex W. Tillerson, as a candidate for secretary of state.
Mr. Tillerson criticized the sanctions as harmful for business after they halted an Exxon joint venture with Rosneft to drill for oil in the Kara Sea, in Russia’s sector of the Arctic Ocean.
The deal will bring Moscow $11.3 billion to help plug a widening budget deficit as Russia fights two wars, in Syria and Ukraine, and has struggled to meet pension payments and public-sector payrolls.
The agreement came as a surprise twist in the privatization of Rosneft. With an end-of-the-year deadline looming, no buyers had come forward for the 19.5 percent share in the world’s largest publicly traded oil company, as measured by production and reserves. The apparent lack of bidders was a pessimistic sign for investor interest in Russia.
The Russian government had for most of the year planned to sell shares back to the majority state-owned company itself, which would hardly have qualified as a genuine privatization.
The sanctions limit long-term lending and transfer of American technology for drilling offshore and shale oil deposits.
The deal carries other risks as well. Both Glencore and the Qatari fund, the Qatar Investment Authority, have extensive investments in emerging markets. The Qatar fund is also an investor in Glencore.
The announced price valued Rosneft at $58 billion, slightly less than the company’s stock market value at the close of trading in Moscow on Wednesday, of just under $59 billion.
Both the market price of shares and the sale price for the 19.5 percent stake announced Wednesday are a relative bargain, indicating the Russian government’s eagerness to cut a deal to shore up its finances.
Rosneft pumps 4.7 million barrels of oil and the energy equivalent in natural gas a day, compared with 4.3 million by Exxon. For comparison, Exxon’s market value was $364 billion during trading Wednesday — six times Rosneft’s value.
The two buyers will take equal parts of the stake, the company’s chief executive, Igor I. Sechin, told Mr. Putin in a televised meeting Wednesday.
Mr. Putin termed it “the largest privatization deal, the largest sale and acquisition in the global oil and gas sector in 2016.”
In a statement, Glencore said it was in “final stage negotiations” over the deal. The company said it would contribute 300 million euros, or $323 million, of its stock to the purchase, with the remainder of the funding coming from the Qatari fund and bank financing. Under the terms, Glencore would gain access to an additional 220,000 barrels a day of Rosneft’s oil to trade.
Mr. Sechin credited Mr. Putin for the agreement. “Given the very difficult economic circumstances and the extremely tight deadlines for this kind of project,” Mr. Sechin said, “I can report to you that we were able to land this deal thanks to your personal contribution.”
The sale completes a long arc for the Russian energy assets, traced from privatization to nationalization to privatization again, with the timing unfavorable for the Russian citizens who are the company’s majority owner.
Under Mr. Putin, the Russian government took oil and gas fields that had been privatized in the early post-Soviet period by companies including Yukos and TNK, and reassembled them under a behemoth state-owned company, arguing that the government should steer policy for these strategic assets.
The government effectively nationalized Yukos in lawsuits over unpaid taxes after its founder, the oil tycoon Mikhail B. Khodorkovsky, was jailed on fraud charges brought with political overtones.
Rosneft bought the assets of TNK and its foreign partner, BP, for about $60 billion in 2013, when oil prices were still buoyant. Now the government is selling shares into the depressed global oil market for a fraction of what it paid three years ago.
A state holding company, Rosneftegaz, is the largest shareholder, with 69.5 percent, which will drop to 50 percent after the sale to Glencore and the Qatari fund. A state property agency holds a voting share to retain majority state control.
BP, the British oil giant, owns a 19.75 percent, and the remainder is traded on the London Stock Exchange and in Moscow.