Fireworks explode as people gather near the courthouse in Benghazi
Fireworks explode as people gather near the courthouse in Benghazi August 22, 2011 to celebrate the entry of rebel fighters into Tripoli. Reuters

U.S. President Barack Obama said on Sunday Muammar Gaddafi's rule was showing signs of collapse and called on the Libyan leader to relinquish power to avoid further casualties.

The surest way for the bloodshed to end is simple: Muammar Gaddafi and his regime need to recognize that their rule has come to an end, Obama said in a statement. Gaddafi needs to acknowledge the reality that he no longer controls Libya. He needs to relinquish power once and for all.

The United States has played a supporting role in the NATO campaign that started in March to protect rebels, protesters

and civilians from attacks by Gaddafi's forces, providing technical support and intelligence to help air strikes.

Obama has said the United States got involved to shield the Libyan people from humanitarian crisis, and pledged in his Sunday evening statement to stay involved after Gaddafi goes.

He called for the Transitional National Council rebels in Libya to take control upon Gaddafi's exit and do everything possible to avoid further casualties, preserve the remaining government institutions and commit to pursuing real democracy after decades of rule by the often erratic Libyan strongman.

At this pivotal and historic time, the TNC should continue to demonstrate the leadership that is necessary to steer the country through a transition by respecting the rights of the people of Libya, Obama said in the statement issued during his annual holiday in Martha's Vineyard, an island near Boston.

The United States will continue to stay in close coordination with the TNC. We will continue to insist that the basic rights of the Libyan people are respected. And we will continue to work with our allies and partners in the international community to protect the people of Libya, and to support a peaceful transition to democracy, he said.

POST-GADDAFI PLANNING

Earlier on Sunday, on his way into a seaside restaurant in the well-heeled town of Oak Bluffs, Obama told reporters he was waiting for a full picture of the upheaval in Libya to emerge before commenting on conditions there.

His written statement came shortly after TNC rebel forces streamed through the Libyan capital of Tripoli, waving flags and firing into the air.

The rebels said the city was under their control except Gaddafi's Bab Al-Aziziyah stronghold, according to al-Jazeera Television. Two of Gaddafi's sons were captured.

Western powers have been intensifying planning for post-Gaddafi Libya in recent days in response to a rapid succession of rebel victories around Tripoli, according to officials involved in the talks.

The NATO alliance on Friday authorized formal planning for post-Gaddafi Libya and TNC members were due to meet officials from the United States, Britain, Jordan and United Arab Emirates to discuss day-after planning in Dubai this week.

The White House believes that unless transition plans are firmed up quickly, post-Gaddafi Libya may be chaotic and it may be impossible to fulfill the West's promise to protect Libya's people from humanitarian crisis.

Some U.S. and European officials fear Libya's opposition movement is not fully ready to govern. Their hope is that enough of Gaddafi's institutions will remain intact to enable the formation of a transitional government that can maintain a measure of civil order.

On Sunday, the U.S. State Department repeated a call for Gaddafi to step aside.

We continue efforts to encourage the TNC to maintain broad outreach across all segments of Libyan society and to plan for post-Gaddafi Libya, said State Department spokeswoman Victoria Nuland. Gaddafi's days are numbered. If Gaddafi cared about the welfare of the Libyan people, he would step down now.