The deal, reached at talks in Moscow between the Russian and Ukrainian leaders, is intended to help Ukraine stave off economic crisis though Moscow will hope it keeps Kiev in its political and economic orbit.
The agreement could also fuel protests in Kiev against Ukrainian President Viktor Yanukovich, who faces accusations of "selling" Ukraine to the highest bidder after spurning a trade deal with the European Union and turning to Moscow for help.
Ukrainian opposition leader Vitaly Klitschko said Mr Yanukovich had betrayed Ukraine's national interests and independence by agreeing to the bailout.
He told crowds on Kiev's Independence Square: "He has given up Ukraine's national interests, given up independence and prospects for a better life for every Ukrainian."
Mr Klitschko, a world heavyweight boxing champion, called for early elections and said he wanted to meet Mr Yanukovich "in the ring".
Russian Finance Minister Anton Siluanov said Moscow would tap a rainy day fund for the £9bn to buy Ukrainian eurobonds.
Announcing the deal after talks in Moscow with Mr Yanukovich, President Valdimir Putin said Russia would help Ukraine through its problems as big debt repayments loom but that there had been no discussion of Kiev joining a Russia-led customs union.
Mr Putin said: "The Russian government has made the decision to convert part of its reserves from the National Welfare Fund into Ukrainian securities.
"I want to draw your attention to the fact this is not tied to any conditions. I want to calm you down - we have not discussed the issue of Ukraine's accession to the customs union at all today."
Mr Putin look confident and relaxed before the talks, slouching in his chair in a gilded Kremlin hall, while Mr Yanukovich sat stiffly and upright beside him in front of the Ukrainian and Russian flags.
In brief comments before the deal was signed, Mr Yanukovich said he hoped for an agreement on a gas price dispute that was "beneficial to both sides".
Ukraine's Naftogaz energy company will pay Russia's Gazprom £165 per 1000 cubic metres of natural gas, on which it is heavily dependent. The previous price had been about £245 per 1000 cubic metres.
The new price will take effect at the start of next month, Ukraine's energy minister said. Traders said Russia had also agreed to resume oil supplies to a refinery in Ukraine after a three-year break.
Ukraine is in the grip of a financial crisis that could hit fuel supplies this winter and had been on the verge of signing a deal which would have brought it closer to the EU but which angered Moscow.