BP said Rosneft agreed to pay $17.1 billion in cash plus shares representing 12.84 percent of Rosneft.
Rather than backing out of Russia, the deal is shifting the firm's holdings from TNK-BP, of which it owned 50 percent, to Rosneft.
BP said it expected to control 19.75 percent of Rosneft, as it would use $4.8 billion of the cash to purchase an additional 5.66 percent of Rosneft from the Russian government. The price BP expect to pay is $8 per share, which represents a 12 percent premium based on Rosneft's closing share price on Thursday.
BP already controls 1.25 percent of Rosneft. It said the deal was contingent on the Russian government agreeing to to sale of 5.66 percent of its stake in Rosneft.
"This is an important day for BP. Russia is vital to world energy security and will be increasingly significant in years to come," said BP's chairman Carl-Henric Svanberg said.
"Our involvement (with Russian energy) has moved with the times. TNK-BP has been a good investment and we are now laying a new foundation for our work in Russia," Svanberg said.
"We consider that this is a deal which will deliver both cash and long term value for BP and its shareholders. It provides us with a sustainable stake in Russia's energy future and is consistent with our group strategy," he said.