The world's leading powers yesterday were scrambling to prevent the violent overthrow of the Gaddafi regime from descending into chaos, even as they quietly jostled to benefit from oil and economic reconstruction contracts to be handed out by a new government in Tripoli.

Last night Western diplomats had a host of concerns, ranging from how Colonel Muammar Gaddafi should be dealt with to post-revolution security and whether the rebel alliance, represented by the Transitional National Council (TNC), would hold together now that its immediate and unifying goal has been achieved.

The TNC, said President Obama, should avoid civilian casualties and pursue a transition to democracy that was "just and inclusive" for all of the people of Libya. A season of conflict, he said, "must lead to one of peace".

In London, David Cameron warned of "undoubtedly difficult days ahead" but said that ordinary Libyans were "closer to their dream of a better future".

But signs of disagreement over the fate of Colonel Gaddafi were an early hint of possible problems. Ban Ki-Moon, the United Nations secretary general, insisted that all UN member countries (of which Libya is one) should comply with the decisions of the International Criminal Court. The ICC has issued arrest warrants for Colonel Gaddafi, his son Saif al-Islam, and Abdullah al-Senussi, his head of intelligence – who was last night reported dead – for crimes against humanity. But the rebels, who have already captured Saif and possibly two other Gaddafi sons, have indicated that they should face trial in Libya, before a Libyan court.

Similar tensions may emerge over a transitional role for the UN as a new government is installed. While some Western countries might favour such a step, Mansour Saif al-Nasr, the rebel movement's spokesman in Paris, ruled out suggestions that a UN force should provide security on the ground, as well as humanitarian aid in the coming weeks.

Some of these issues could be settled at an international meeting next week of the Western "contact" powers on Libya, to be attended by top TNC figures, announced by President Nicolas Sarkozy of France, which along with Britain led the Nato air support operations for the rebels.

Hardly less pressing is the reconstruction effort that will be needed after months of fighting that has caused considerable infrastructure damage and reduced the flow of oil from Libya, the world's 12th largest exporter, to a trickle. Resources will be available – the World Bank says it will quickly resume involvement with Libya, while Britain and Germany were among countries promising to unfreeze tens of billions of dollars in assets held by the old regime.

Most oil companies involved in Libya have not commented, or said they would wait to see how the security situation evolved before sending their personnel into the country.

Italy, Libya's former colonial power and largest trading partner, has meanwhile sent a team to the rebels' "capital" of Benghazi to work on plans to restore oil and natural gas production to pre-war levels. The Foreign Minister Franco Frattini said yesterday that the Italian energy group ENI - the largest foreign producer in Libya - "will have a No. 1 role in the future" of the country.

But international competition to secure a foothold in the new Libya is likely to be intense, involving not only the traditional industrial powers but also China, which has already moved to bolster its oil and raw material supplies in deals with other African countries.

BP vows to return

BP has announced that it wants to return to Libya as soon as possible to resume its search for oil. It left the country earlier this year, soon after starting a £121m drilling project, when the violence intensified.

A spokesman said: "Our plans are simple: to return to the country when conditions allow and restart the exploration programmes we had in place."

Following Tony Blair's 2004 "Deal in the Desert" with Gaddafi, which opened Libya up to some British businesses, BP signed deals with the regime to explore oil fields in the western Ghadames Basin and to drill offshore in the Sirte Basin. Western energy giants will seek reassurances from rebel leaders that those deals remain intact.

BP said infrastructure does not yet exist for it to begin production, and that it was "several years away from producing anything, even if our exploration goes as well as we wish". The firm will now consider when to send back its expat workers, having kept about 100 locals on the payroll during the fighting. Kevin Rawlinson

The world jostles for position

Russia

"We have lost Libya completely," Aram Shegunts, of the Russia-Libya Business Council, complained yesterday, voicing fears that Russian energy companies would be frozen out of any post-conflict carve-up of Libya. The official line from Moscow came from the Foreign Ministry, which warned against foreign interference in Libya. "We call on all states to... refrain from interference in Libya's internal affairs and provide practical support."

China

China, which abstained on the UN vote to use military force against Gaddafi's regime in March, said yesterday that it would accept the rebel succession. "China respects the choice of the Libyan people and hopes that the situation there will quickly return to stability and that people's lives can return to normal," the Foreign Ministry said. In truth, China has long been hedging its bets against Gaddafi's ability to survive, hosting rebel leaders in Beijing on several occasions.

UK

David Cameron called on Gaddafi to go quietly and stem further bloodshed. The Prime Minister said that Gaddafi's power was ebbbing away and, "at least two of Gaddafi's sons have been detained, his regime is falling apart and is in full retreat. Gaddafi must stop fighting, without conditions – and clearly show that he has given up any claim to control Libya." Mr Cameron warned, however, that it could be some time before Gaddafi was found.

US

President Obama repeated his demands that Gaddafi give himself up yesterday, adding that the 42-year tenure as Libyan leader was over. "The surest way for the bloodshed to end is simple... Gaddafi and his regime need to recognise that their rule has come to an end," Mr Obama said. "[He] needs to acknowledge the reality that he no longer controls Libya. He needs to relinquish power once and for all."

EU

The EU embraced the developments in Tripoli, hailing what it described as "a new era". Despite the continued fighting, Jose Manuel Barroso, President of the European Commission, and Herman van Rompuy, President of the European Council, said: "The quest for freedom by the people of Libya is coming to a historic moment. The relentless efforts of the forces of the new Libya, supported militarily by Nato and several EU states, are bringing the Gaddafi regime to its end."

Nato