LONDON — BP, the British oil company, announced on Friday that it intended to buy back as much as $8 billion worth of its stock to return cash to shareholders after closing the sale of its 50 percent stake in a Russian joint venture.

The company completed the sale of its stake in the venture, TNK-BP, to Rosneft, the Russian state oil company, on Thursday for $12.48 billion in cash as well a 19.75 percent stake in Rosneft.

The $8 billion is roughly the equivalent of what BP originally paid for its 50 percent of TNK-BP in 2003. Over the last 10 years BP also received $19 billion in dividends from the venture, the company said.

BP said the remaining $4.48 billion from the stake sale would be used to reduce debt.

The buyback is about twice as large as analysts were expecting, said Andrew Whittock, an analyst at Liberum Capital in London, in a research note.