* Rosneft to get at least $1.5 bln in pre-payment
* Follows BP-Rosneft shale oil exploration deal
(Adds further details, background)
KHABAROVSK/MOSCOW, Russia, June 27 (Reuters) - Rosneft signed on Friday its second major agreement with BP since sanctions were imposed on the Russian oil company's chief executive, a close ally of President Vladimir Putin, over Russia's involvement in the Ukraine crisis.
The five-year agreement will supply BP with up to 12 million tonnes of refined oil products and involves a pre-payment of at least $1.5 billion arranged by leading global financial institutions, Rosneft said.
Rosneft's entire annual refinery production capacity stands at nearly 90 million tonnes, according to company figures.
Some Western firms have been wary of investment and business in Russia since sanctions were imposed over the crisis in Ukraine, where Moscow denies accusations of orchestrating a rebellion by pro-Russian separatists.
But the sanctions have had only a limited impact on the Russian energy industry, a cornerstone of the country's $2-trillion economy, resulting mostly in higher borrowing costs for domestic companies.
Since the sanctions were imposed, executives from Total , BP, Statoil and ExxonMobil have visited Russia, underlining the importance they attach to business with the world's leading oil producer with current output of around 10.5 million barrels per day (bpd).
Last year, Rosneft announced deals worth more than $15 billion to sell crude oil and other products to BP, which now owns almost a fifth of Rosneft following Rosneft's acquisition of Anglo-Russian oil firm TNK-BP last year.
Friday's signing also follows an agreement by BP and Rosneft in May to jointly explore in Russia for hard-to-recover shale oil.
Such deals do not violate sanctions over the Ukraine crisis because Rosneft has not been included on any sanctions list, but Rosneft's chief executive Igor Sechin had a visa ban and asset freeze slapped on him by the United States after Russia annexed the Black Sea peninsula of Crimea from Ukraine in March.
"I am working here with Rosneft. It's a business between the companies. I don't comment on personal sanctions," BP's chief executive Bob Dudley told reporters in Khabarovsk in Russia's far east after attending the signing ceremony with other members of the Rosneft board of directors.
Rosneft did not disclose the name of the banks involved in arranging the pre-payment but said supplies to BP could start next month.
Bankers earlier this month said partly state-owned UK lender Lloyds Bank had pulled out of the $1.5-$2 billion trade finance deal to avoid risking any political embarrassment for its government.
The British bank, along with Deutsche Bank, HSBC and Bank of China, had been a mandated lead arranger on the loan, banking sources said.
Under the terms of the latest deal, Rosneft said oil product deliveries could be substituted for supplies of oil but gave no explanation of the circumstances under which this could happen.
Such pre-payment supply deals have raised billions of dollars for Rosneft, which borrowed $30.1 billion in two separate loans in 2012 and 2013 to help finance last year's $55 billion acquisition of TNK-BP, once Russia's third largest oil producer.
Last year Rosneft also agreed an $8.32 billion loan with commodity traders Glencore and Vitol and a $1.5 billion pre-payment loan with Swiss-based trading house Trafigura.
However, some Russian energy companies have recently been talking to their customers about a possible switch to using currencies other than the U.S. dollar in transactions to minimise sanction-related risks.
Other companies could also now follow the example of Surgutneftegas, Russia's fourth-biggest oil producer with an average daily output of 1.2 million barrels of crude, which according to its accounts has stockpiled over 1 trillion roubles ($30 billion) of cash instead of paying out higher dividends or making large acquisitions.
Meanwhile Lukoil, Russia's second-biggest oil producer, has postponed an up to $2 billion Eurobond issue until the autumn because of a spike in borrowing costs.
($1 = 33.6595 Russian roubles)
(Writing by Katya Golubkova; Editing by Timothy Heritage and Greg Mahlich)