Media playback is unsupported on your device Media caption James Reynolds reports as BP say the oil has stopped leaking

BP says it has temporarily stopped oil flowing into the Gulf of Mexico from its leaking well.

It is the first time the flow has stopped since an explosion on the Deepwater Horizon rig on 20 April.

The well has been sealed with a cap as part of a test of its integrity that could last up to 48 hours.

US President Barack Obama said the development was a "positive sign" but noted that BP was still in the testing phase.

BP executive Kent Wells said the oil had been stopped at 1425 local time (1925 GMT) and he was "excited" by the progress.

"It is very good to see no oil go into the Gulf of Mexico," said Mr Wells.

BP shares rose in New York trading on Thursday after the flow was stopped, having already performed well over the day.

But BP is stressing that even if no oil escapes for 48 hours, that will not mean the flow of oil and gas has been stopped permanently.

BP chief operating officer Doug Suttles emphasised that there was no reason for "celebration" yet, particularly for those in areas already damaged by oil.

What happens now? Progress discussed by experts every six hours

Test will last as long as 48 hours

If pressure drops significantly well will be reopened immediately

After test finishes, well could be reopened while seismic test is done

If test is successful well could be kept shut until relief well is finished

Or oil could be piped to vessels on surface as before

Three vessels on site can capture 50,000 barrels a day

And BP say use of fourth vessel by end of July would take capture up to 60-80,000 barrels

Relief well on course permanently to kill well by mid-August

"The job is not finished," he said.

The pressure testing is necessary to check the strength of the well. If the pressure within the cap on top is low, that could indicate oil is leaking out further down the well.

If the pressure remains high, BP and the government will have to decide whether to try to keep the well shut or to leave it open and pipe oil to four vessels on the surface.

The US government's incident commander, Adm Thad Allen, said even if it was successful, the well would be reopened and oil capture by ships on the surface would restart while a seismic test was done.

"We can go back then and put the system under pressure again. Once we are convinced we can certainly consider shutting in the well, that is always possible and we would certainly look to do that."

But he emphasised that the option of shutting in the well - closing all the valves and stopping the flow - was a "side benefit" of the new capping stack.

At the scene After three months of this - and so many failed attempts - people are sceptical. But at the same time the mood has brightened considerably, because this oil spill has had a deadening psychological effect on the Gulf Coast. The long-term plan is still to dig a relief well which will intercept the leaking one. People have just left this coastline, tourists in particular, because they don't want to run the risk of having a vacation ruined by oil This could all go wrong. We're only a few hours into the tests.

The priority had always been to increase the amount of oil being captured and piped to the surface, he said.

Whatever happens will be a temporary solution, ahead of a relief well being used permanently to kill the original well with mud and cement. The pressure test will provide useful information for that operation.

Work on both of the relief wells is currently suspended because of the integrity test. One of the relief wells is within 4-5ft horizontally and 100ft vertically of intersecting.

The pressure test was twice delayed before starting on Thursday, once while additional checks were put in place to allay fears it could make the leak worse, and on Wednesday by a leaking piece of equipment.

Meanwhile, BP continues to face political pressure in the US.

A congressional committee has agreed measures that would ban the firm from new offshore drilling for seven years.

Lockerbie allegations

And in a separate move, Secretary of State Hillary Clinton has said she will look into a request by four senators to investigate allegations that BP lobbied for the release of Lockerbie bomber Abdelbaset al-Megrahi while attempting to finalise an oil deal with Libya.

The Senate Foreign Relations Committee announced on Thursday it would hold a hearing on 29 July into the circumstances of Megrahi's release.

The 1988 bombing of Pan Am flight 103 killed 270 people - most of them were American.

Megrahi, who has terminal prostate cancer, was freed by Scottish Justice Secretary Kenny MacAskill on compassionate grounds in August 2009 after serving eight years.

In a statement on Thursday, BP admitted it had expressed concern to the UK government about the slow progress of a prisoner transfer agreement between the two countries.

But the firm said it had taken no part in discussions on the decision to free Megrahi.

And the UK ambassador to Washington, Sir Nigel Sheinwald, said: "Claims in the press that Megrahi was released because of an oil deal involving BP, and that the medical evidence used by the Scottish Executive supporting his release was paid for by the Libyan government, are not true."