BP shares gained in London on Friday after its boss survived a bruising encounter with U.S. lawmakers and as hopes rose its $20 billion oil spill compensation and clean-up fund will cap public anger.

The worst oil spill in U.S. history, from a leaking deepwater well in the Gulf of Mexico, has strained the reputation of U.S. President Barack Obama, sullied the region's rich wildlife, and wounded its fishing and tourism industries.

The likely cost of cleanup, compensation and fines has almost halved the value of BP -- once Britain's biggest company.

Chief Executive Tony Hayward survived attacks on him by a congressional committee on Thursday, though some investors were unimpressed with his showing.

One top-20 investor, who declined to be named, said: Hayward's performance yesterday was awful -- it was so contrived. But to be honest, he couldn't really say much. It was case of 'damned if he did and damned if he didn't'. He was put forward as a sacrificial lamb.

But shares rose as some previously cautious analysts upgraded the stock.

Collins Stewart and Societe Generale upped their ratings to Buy from Hold, saying the share drop since the spill started was so severe that BP now offered good value.

Most analysts have kept buy or outperform ratings on BP as the shares collapsed, citing their cheapness relative to the company's asset base and rivals' shares, though BP has lost 44 percent in the two months since the April 20 explosion that killed 11 people.

At 1301 GMT (9:01 a.m. EDT), shares in BP were trading up 2.4 percent at 368 pence, shaking off the third downgrade to its credit rating this week, this time by Moody's.

Moody's cut BP's rating by three notches, saying that the spill would hit cash flow for a number of years and that the fund would not cap liabilities.

Standard & Poor's had downgraded BP on Thursday, describing the fund as a competitive disadvantage, and said it could cut again if costs rise. Fitch had led the way on Tuesday with a six-notch downgrade.

I think it (the share reaction) is just follow-through from the relief that maybe the worst of U.S. public opinion might have been capped, if not the leak or the bill, says Oriel Securities analyst Brendan Wilders, who has a buy rating on the stock.

OIL STILL SPEWING

From a mile below the surface, crude oil continues to gush at a rate of up to 60,000 barrels a day, although BP is siphoning off some using a containment cap system and is drilling relief wells it hopes will halt the leak in August.

Louisiana Treasurer John Kennedy estimates environmental and economic damage could range up to $100 billion for his state and others along the Gulf Coast.

That domestic political pressure underpinned a grueling week in Washington for Hayward, who survived a trip to the White House to meet an angry President Obama on Wednesday and then endured a verbal assault from lawmakers on Thursday.

His failure to explain the causes of the spill, however, led to renewed calls for him to go.

No one at BP has been fired, Florida Democratic Representative Kathy Castor told Reuters Insider after the hearing. It's time for heads to roll at BP.

In the meantime, some in the industry see BP as vulnerable to a takeover -- weakened by the $20 billion fund it is having to create.

I would be shocked if two years from now BP is still an independent company, said Christopher Zook, chairman and chief investment officer of CAZ Investments in Houston.

Russian President Dmitry Medvedev added to the negative outlook in a Wall Street Journal interview on Thursday, where he questioned whether the oil spill might lead to the breakup of BP and described the spill as a wake up call.

To help plug the gaping hole in its finances left by the spill clean-up fund, BP has announced plans for a $10 billion asset sale programme, although on Friday it said it had no plans to sell its stake in top Russian oil firm Rosneft.

BP has not sold... and we are not planning to sell, David Peattie, head of BP's Russian operations, told reporters on the sidelines of the St Petersburg Economic Forum.

MORATORIUM

The disaster, which fouled at least 120 miles of coastline and damaged the multibillion-dollar fishing and tourism industries, killing dolphins and other sea life, prompted Obama to ban deepwater offshore drilling for six months.

The International Energy Agency (IEA) has said the spill would raise costs, delay new projects and prompt a thorough review of offshore regulation.

The IEA's executive director, Nobuo Tanaka, told Reuters in a interview it estimated 100,000-300,000 barrels per day could be lost if new projects in the Gulf of Mexico were delayed by one or two years until 2015.

If the same one-year or two-year delay happens globally, to global offshore drilling new projects, if that happens, we calculate it is about 800,000 to 900,000 barrels per day, he said. This amounts to about 1 percent of current total oil production.

Environmentalists, however, are concerned the flurry of headlines around the political theater in Washington and market reaction in London and elsewhere is taking the focus off the ecological disaster.

This oil is already into the wetlands and more is coming up every day. You cannot clean it out of there, John Hocevar, a marine biologist with Greenpeace, told Reuters in Louisiana. The impact of the spill is going to be felt for decades.

($1=.6743 Pound)

(Additional reporting by Jeffrey Jones in Louisiana, Deborah Zabarenko, Timothy Gardner, Alina Selyukh in Washington, Kristen Hays in Houston, Raji Menon and Sarah Young in London, Michael Erman, Dena Aubin and Walden Siew in New York; Writing by Simon Jessop; Editing by Andrew Callus)