"It is the largest privatisation deal, the largest sale and acquisition in the global oil and gas sector in 2016," President Vladimir Putin said.
The surprise move sees Glencore and Qatar paying $11.3bn for the stake in Rosneft, where BP already owns 19.75%.
Moscow will keep the controlling stake.
The long-planned sale is part of the Russian government's efforts to sell some state assets to help balance the budget amid a two-year recession caused by a drop in global oil prices and Western sanctions.
A deadline for the sale was missed, and speculation grew that Rosneft was struggling to find a buyer.
The deal also marks a turnaround for London-listed Glencore, which had seen a collapse in its share price amid a plan to sell assets and cut its huge debts.
Glencore's shares have rebounded this year. The Qatar Investment Authority is one of the biggest investors in Glencore.
Speaking at a televised meeting with Rosneft chief executive Igor Sechin, Mr Putin noted that the deal follows a rally in global oil prices after Opec's decision to cut production.
Russia, although not a member of Opec, has agreed to cut its output in line with the cartel, and will attend a meeting with its member countries on Saturday to discuss specific details.
Mr Sechin said that Glencore and the Qatari fund will form a consortium and have equal stakes. He added that Rosneft had conducted talks with more than 30 potential bidders before striking the deal.
It had been thought that US and EU sanctions imposed on Russia following the Ukraine conflict would deter huge investment in Russia, although companies were not explicitly prohibited from participating in the Rosneft sale.
The election of Donald Trump as US president has, however, raised speculation of a thaw in relations with Moscow.
Glencore said in a statement that it would finance part of the deal by putting up â‚¬300m of its own equity, with the rest financed by banks and by the Qatari sovereign fund. QIA had yet to make a statement.
The commodities trader stands to benefit by gaining access to Rosneft's crude output, while Qatar will further establish itself as a major investor in some of the world's biggest businesses.
The Kremlin has announced that commodities trader Glencore and Qatar's sovereign wealth fund are together buying a 19.5% stake in Rosneft, Russia's largest oil company.