Shares in BP hit two-month highs on Thursday on hopes the group would soon permanently seal its Gulf of Mexico oil well and after President Obama said the battle to contain the leak was nearly over.

BP shares were up 2 percent at 430 pence at 5:44 a.m. ET, having earlier hit 434.5 pence, a level last seen in early June, on day 108 of an environmental disaster that has ravaged communities and ecosystems along the Gulf coast, killed sea creatures and coastal birds and cost Chief Executive Tony Hayward his job.

After several setbacks in efforts to plug the deep-sea well, which was damaged by an explosion at a rig on April 20, BP said on Wednesday that heavy drilling mud injected into it the previous day was stemming the flow of crude.

Analysts said the development underscored a growing sense that the worst was over for BP.

Nobody thinks they are going to go bust in the next five years any more, said Iain Armstrong, an analyst at Brewin Dolphin.

Following the initial success of its static kill operation, U.S. authorities gave the company permission to begin cementing the well, but the permanent solution still lies in a relief well, which should be completed later this month.

Cement pumping is expected to begin later on Thursday, but BP did not issue an update early in the day.

The long battle to stop the leak and contain the oil is finally close to coming to an end, said President Obama, whose approval ratings have been hurt by public discontent over his administration's handling of the spill.

The static kill is part of a two-pronged strategy to kill the well for good. The relief well is seen as the final solution. After it intercepts with the ruptured well shaft, mud and cement will be pumped in to plug the oil reservoir 13,000 feet beneath the seabed.

UNKNOWN LIABILITIES

BP shares, which had at one stage lost more than $100 billion in market value, have gained 46 percent since hitting a 14-year low on June 25 on hopes that it would be able to contain the spill and sell assets to help meet costs.

The stock is still off by a third from levels before the April 20 accident, which killed 11 people.

Brewin's Armstrong said he expected analysts to lower their estimates for how much the spill would cost but added that investors needed to tread carefully.

Before you get too carried away yet, you've got a massive unknown set of liabilities, he said.

As BP reported success in the Gulf, a team of government scientists said about 50 percent of the spilled oil had been captured, evaporated, burned or skimmed, while another quarter had been naturally or chemically dispersed.

The rest was either on or just beneath the water's surface as light sheen or weathered tarballs, had washed ashore or was buried in sand and sediments at the sea bottom, they said.

The financial implications for BP's continued clean-up efforts were not immediately clear. Government officials have said in the past that it would take years to fully repair the damage inflicted by the spilled oil, which seeped into ecologically sensitive wetlands and marshes.

More than 1 million barrels of oil remain in the Gulf, four times the 257,000 barrels that spilled into Alaska's Prince William Sound from the Exxon Valdez tanker in 1989.

A senior government official said the amount of oil remaining on the surface of the ocean was negligible, but she acknowledged that the dispersed oil, even in microscopic droplet form, was still highly toxic to marine creatures.

We remain concerned about the long-term impacts both on the marshes and the wildlife, but also beneath the surface, and are actively studying that, said Jane Lubchenco, who heads the National Oceanic and Atmospheric Administration.

The total amount of oil was immense, and the impact is likely to be considerable, even though Mother Nature is helping the federal effort, she said.

The National Wildlife Federation said hundreds of birds and sea turtles had been rescued or found dead in the first days of August, underlining the continued danger the oil poses.

White House spokesman Robert Gibbs said the focus was shifting from efforts to cap the well to the long-term plan to clean up the rest of the oil and restore the Gulf region.

It is sort of the beginning of the end of the sealing and containment phase of this operation, Gibbs told reporters.

Democratic Senator Mary Landrieu, whose Louisiana state has been hard hit by the spill, said the crisis was far from over.

The Gulf Coast needs significant investments for recovery and restoration, and we're going to hold BP accountable and we're going to hold the federal government accountable, she said in an interview with Reuters Insider television.

The spill also disrupted the livelihoods of fishermen and tourism operators and triggered a barrage of damages lawsuits against BP, which has said it will pay all legitimate claims.

Earlier this week, government scientists reported that about 5 million barrels of oil may have leaked from the BP well before it was temporarily capped on July 15.

(Additional reporting by Ed Stoddard in Dallas, Rodrigo Campos and Matthew Lynley in New York and Tom Bergin in London, Matt Spetalnick, Jeff Mason, Alister Bull and Alina Selyukh in Washington, Matthew Lynley in New York and Kristen Hays in Houston; Writing by Sitaraman Shankar and Ross Colvin; Editing by Alan Elsner and Will Waterman.)