* Profits rise 36 percent on year on strong production
* Russia sanctions so far had no impact, but new measures could
* BP the biggest foreign investor in Russia with Rosneft stake
* BP shares up 0.5 pct
(Adds detail, quotes from company, analysts)
LONDON, July 29 (Reuters) - Oil and gas producer BP reported a sharp rise in second quarter profits on Tuesday but warned that further Western sanctions on Russia could harm its business there and its relationship with Russian state oil company Rosneft.
BP said that to date, the sanctions had not had a significant effect on its business in Russia, where it makes about a third of its crude oil output, but that could change.
"If further international sanctions are imposed on Rosneft or new sanctions are imposed on Russia or other Russian individuals or entities, this could have a material adverse impact on our relationship with and investment in Rosneft, our business and strategic objectives in Russia and our financial position and results of operations," it said.
BP, by far the largest foreign investor in Russia through its 19.75 percent stake in Russian state oil company Rosneft, has repeatedly said it will stand by its investments in Russia since Moscow's intervention in Ukraine, where pro-Russian rebels are fighting government forces in the east of the country.
But things could get harder as the European Union weighs a new set of punitive measures against Moscow in response to the downing of a Malaysian airliner in eastern Ukraine. Additional sanctions could include financial restrictions and a ban on exports to Russia of equipment for use by oil and gas producers.
BP is not the first to make such a warning. Last week French oil services firm Technip cut margin targets for its onshore/offshore unit for this year and next, citing the possible impact of sanctions on Russia, which it said could interrupt income flows from Yamal LNG in Siberia.
For the second quarter, BP said underlying replacement cost profit rose to $3.6 billion, up 36 percent from a year earlier, beating analysts' forecast of $3.49 billion.
Its share of profits from Rosneft topped $1 billion in the quarter, nearly five times higher than a year earlier as a result of "favourable foreign exchange effects" with the Russian rouble. It also received an annual dividend of $690 million from Rosneft in the last two weeks.
"This was another successful quarter, delivering both operational progress and robust cash flow," said BP chief executive Bob Dudley, who also sits on the Rosneft board.
BP shares were up 0.5 percent at 499.3 pence at 0800 GMT in a flat European oil and gas sector.
The robust results were underpinned by good production performance from new and recently started higher-margin upstream projects, primarily in the Gulf of Mexico, as well as increased processing of heavy crude oil by the newly modernised refinery at Whiting, Indiana, in the United States.
"The company's core competency operating offshore again came to the forefront with production being especially strong in the Gulf of Mexico. Higher crude prices also helped against pretty low market expectations," said Brian Youngberg, senior energy analyst at Saint Louis, Missouri-based investment firm, Edward Jones, which maintained its 'hold' rating on BP shares.
Overall, second-quarter production fell 3 percent to 3.1 million barrels of oil equivalent a day.
BP's upstream segment reported $4.7 billion underlying pre-tax replacement cost profit, compared with $4.3 billion a year earlier and $4.4 billion in the first quarter of 2014.
Total operating cashflow for the first half of 2014 was $16.1 billion, placing it in line with its goal of reaching around $30 billion in cash flow this year.
BP maintained its quarterly dividend of 9.75 cents per share.
BP has also increased its divestments as part of a sector-wide drive to reduce spending and contain rising costs with the recent sale of its Hugoton gas assets in Texas for $390 million.
It has sold $3.4 billion worth of assets since 2013 out of a planned two-year total of $10 billion divestments, in addition to around $40 billion worth of assets already sold to help pay for the Deepwater Horizon spill in the Gulf of Mexico in 2010.
Like most of its peers, including Royal Dutch Shell , BP is under heavy pressure from shareholders to boost dividends and tighten its budgets as soaring costs in the oil and gas industry and relatively stable oil prices crimp profitability.
(Adduitional reporting by Karen Rebelo in Bangalore; Editing by Will Waterman)