Barack Obama has insisted he is considering every intervention option in Libya, including military might, along with America's allies.

And he sent a message to Libyan dictator Muammar Gaddafi, declaring: "Step down from power and leave."

Wary that Libya's bloody crisis could become a humanitarian disaster, the US president made clear last night that he has not ruled out establishing a no-fly zone to prevent Gaddafi's air forces from bombing rebels.

Mr Obama's broad assurance came a day after his defence chief Robert Gates said bluntly that a no-fly zone would amount to an act of war and warned about too much "loose talk" of US military intervention in Libya.

"I don't want us hamstrung," Mr Obama said in defending his approach. But the president also made clear he did not intend to act without the consent of international peers and that the emphasis of the US was on helping refugees, heading off a humanitarian crisis and hastening the end of Gaddafi's reign.

"There is a danger of a stalemate that, over time, could be bloody," Mr Obama said during an appearance with visiting Mexican president Felipe Calderon.

"And that is something that we're obviously considering. So what I want to make sure of is, is that the US has full capacity to act, potentially rapidly, if the situation deteriorated in such a way that you had a humanitarian crisis on our hands."

But in the Libyan capital Tripoli, Gaddafi vowed to "fight until the last man and woman" and lashed out at Europe and the US for their pressure on him to step down, warning that thousands of Libyans would die if US and Nato forces intervened in the conflict.

The Libyan uprising, part of an upheaval across North Africa and the Middle East, has pitted anti-government protesters against the strongman who has ruled for four decades.

Gaddafi has unleashed a violent crackdown against those seeking his ouster, drawing international condemnation and sanctions. Hundreds have been killed, perhaps more.

Trying to impose pressure, but with only so much leverage, Mr Obama suggested that Gaddafi loyalists should switch sides in support of the revolutionaries.

"Those around him have to understand that violence that they perpetrate against innocent civilians will be monitored and they will be held accountable for it," he said.

"And so to the extent that they are making calculations in their own minds about which way history is moving, they should know history is moving against Colonel Gaddafi."

Calling Gaddafi a ruler with no legitimacy, Mr Obama said: "Colonel Gaddafi needs to step down from power and leave."

Mr Obama's comments came as rebels strengthened their hold on the strategic oil installation at Brega after repelling an attempt by Gaddafi loyalists to retake it.

The US president announced that American military aircraft would play a humanitarian role by helping Egyptians who had fled Libya and become stranded in Tunisia. The planes are to fly them from Tunisia back to Egypt.

Officials say US aircraft could leave as early as today for the first mission, but details were still unfolding.

On the prospect of a military response, Mr Obama made clear he did not plan to have the US go it alone. He said US responses to the uprising in Egypt ensured that "we did not see anti-American sentiment arising out of that movement".

"The region will be watching carefully to make sure we're on the right side of history, but also that we are doing so as a member of the world community," he said.

The Pentagon has ordered two warships into the Mediterranean, but Mr Obama did not discuss the possibility of specific military actions such as providing air cover for rebels.

The US, Britain and other Nato countries are drawing up contingency plans to impose a no-fly zone over Libya. But the idea has been rejected by Russia, which holds a veto-holding seat on the United Nations Security Council.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.