* Qatar to hold a direct stake of 19 percent in Rosneft
* Boosts Qatar's ties with the Kremlin amid Gulf boycott
* China's CEFC probe led to the deal collapse (Changes date, updates with CEFC reaction; deal background)
By Dmitry Zhdannikov and Olesya Astakhova
LONDON/MOSCOW, May 5 (Reuters) - Qatar is taking a nearly 19 percent stake in Rosneft, rescuing the Russian oil major from its stalled deal to sell a major stake to China's CEFC.
The deal strengthens ties between Moscow and Doha at a time when Qatar is facing boycott by its Gulf Arab neighbours.
Qatar's sovereign investment fund QIA initially bought 19.5 percent in Rosneft together with Swiss trading giant Glencore for 10.2 billion euros ($12.2 billion) during the Russian firm's partial privatisation in 2016.
But last year the consortium agreed to sell a 14.16 stake in Rosneft to CEFC China Energy in a $9.1 billion deal that was seen as key to helping expand relations between Russia and China, the world's top energy exporter and top consumer.
That deal ran into trouble after CEFC Founder and Chairman Ye Jianming was put under investigation by Chinese authorities over suspected economic crimes, Reuters reported in March.
Glencore said on Friday that the consortium that had been selling the Rosneft stake had been dissolved, and said Qatar and Glencore would now own stakes directly.
QIA would control an equity stake of 18.93 percent and Glencore would hold some 0.57 percent.
CEFC has not commented publicly since the termination of the deal was announced. The company did not immediately respond to Reuters requests for comment. Calls to its Shanghai headquarters were not answered on Saturday.
The once high-flying conglomerate is now conducting fire sales of its assets following the investigation into its chief and offering staff severance packages after failing to pay them for two months, as creditors scramble to collect debts amid growing regulatory scrutiny of the firm.
"CEFC China's purchase of a stake in Rosneft has ended in a debacle. Russia's pivot to the East now feels more like a pivot to the Middle East, with Qatar coming to the rescue," said Christian Boermel, senior research analyst, Russia Upstream, at energy consultancy Wood Mackenzie.
Rosneft was hit hard by U.S. sanctions on Russia over Moscow's annexation of Crimea and incursion in east Ukraine.
But sources close to QIA have said Rosneft could prove a profitable long-term investment given the giant firm is worth only $65 billion despite producing more crude than U.S. ExxonMobil, which is worth $324 billion.
The fate of the CEFC deal, one of the largest investments by China in Russia, was seen as a litmus test of how far President Xi Jinping's government was prepared to go with a crackdown on financially risky activities among big-spending conglomerates.
Rosneft has, however, said it continues to consider China as a strategic market and that it will supply its term contracts based on the agreed timing and volumes to CEFC.
The Russian oil major in 2017 signed a five-year contract to supply 12 million tonnes of oil per year to the Chinese firm.
Glencore will also keep its long-term crude offtake agreement with the Russian producer under the new arrangement, a source told Reuters. ($1 = 0.8365 euros) (Addditional reporting by Olga Yagova and Katya Golubkova, and Kane Wu in Hong Kong; Editing by Edmund Blair and Himani Sarkar)