The rout came as the U.S. director of national intelligence stressed that Gadhafi's military was stronger than it has been described and said that "in the longer term ... the regime will prevail." President Barack Obama has called on Gadhafi to step down, and the White House later distanced Obama from the director's assessment.
Hundreds of rebels in cars and trucks mounted with machine guns sped eastward on the Mediterranean coastal road in a seemingly disorganized flight from Ras Lanouf as an overwhelming force of rockets and shells pounded a hospital, mosque and other buildings in the oil complex. Doctors and staff at the hospital were hastily evacuated along with wounded from fighting from the past week.
The opposition, however, made some diplomatic gains. France became the first country to recognize the rebels' eastern-based governing council, and an ally of President Nicolas Sarkozy said his government was planning "targeted operations" to defend civilians if the international community approves. U.S. Secretary of State Hillary Rodham Clinton said she would meet with opposition leaders in the U.S., Egypt and Tunisia.
In Tripoli, Gadhafi's son Seif al-Islam vowed to retake the eastern half of the country, which has been in opposition hands since early in the 3-week-old uprising.
"I have two words to our brothers and sisters in the east: We're coming," he told a cheering crowd of young supporters. The son depicted Libyans in the east as being held "hostage" by terrorists.
Gadhafi's government sent a text message to Tripoli residents, warning imams at mosques against allowing protests after Friday prayers. The message quoted Saudi cleric Sheik Saleh Fawzan, a member of the Saudi Supreme Scholars Council, as saying it was "unacceptable" for any imam "who incites people (or) causes disturbances of the society in any mosque."
There were demonstrations after prayers for the past two Fridays, and militiamen used tear gas and live ammunition to disperse the crowds who had gathered in mosques. There were an undetermined number of deaths after the Feb. 25 demonstrations.
The retreat was a heavy blow for the ragtag rebel forces of armed civilians and mutinous army units that only days before had confidently charged west, boasting they would march the hundreds of miles (kilometers) to "liberate" Tripoli.
There were no concrete signs of Western moves toward military assistance that the opposition has been pleading for. A rebel spokesman went beyond repeated calls for a no-fly zone to prevent Gadhafi's air force from harrying opposition fighters and said the West should carry out direct strikes against regime troops.
"We have requested for all steps to be taken to protect the Libyan people. We believe the U.N. can do that. The bombardment of mercenaries and Gadhafi troop camps are among our demands," Abdel-Hafidh Ghoga, a spokesman of the governing council, told reporters in the opposition's eastern bastion of Benghazi.
The rebel capture of Ras Lanouf a week ago had been a major victory as they pushed along Libya's long Mediterranean coastline toward Tripoli, in the far west of Libya. A day after seizing it, their forces charged farther ahead, reaching the outskirts of Sirte, Gadhafi's hometown and a stronghold in the center of the country.
They were met there by a heavy counterattack that in the past week steadily pushed them back toward Ras Lanouf, 380 miles (615 kilometers) east of Tripoli, even as the rebels tried to build supply lines to keep up momentum.
The regime's offensive appeared to build in force. On Thursday morning, rebels were bringing in heavier weapons such as multiple-rocket launcher trucks and small tanks to the front lines just west of Ras Lanouf. But they came under a powerful barrage of shelling that pushed them back along the flat, desert scrubland into the tiny oil port.
A torrent of artillery and tank shells pounded around the facilities and the adjacent residential areas - long deserted amid the fighting.
Akram al-Zwei, an opposition leader in nearby Ajdabiya, said gunboats off shore joined the bombardment, though that could not be independently confirmed. He said four battalions of pro-Gadhafi troops were involved in the assault, battling the opposition's civilian militias and an eastern-based special commando unit, the Saiqa 36 Battalion, that had joined the rebellion.
Rebels fought back with rocket fire and anti-aircraft guns. But the fighters, mostly armed with assault rifles, appeared outgunned. "We don't have any heavy weapons," shouted one fighter, named Ali.
By the afternoon, many rebels were speeding east from Ras Lanouf in a frantic evacuation, most converging on the opposition-held oil port of Brega and Ajdabiya, 100 miles (160 kilometers) away. "Everyone just started leaving. It's not organized," said one retreating fighter. "The weapons we have just don't reach them."
Ras Lanouf's main hospital was hit by artillery or an airstrike, and the rebels pulled their staff out and evacuated patients to Brega and Ajdabiya, said Gebril Hewada, a doctor on the opposition's health committee in Benghazi, Libya's second-largest city.
At least four rebel fighters were killed, 35 wounded and 65 missing in the fighting, according to doctors in Brega.
It was not clear whether government forces completely held Ras Lanouf. Al-Zwei and Ghoga, the opposition spokesman, claimed it remained in rebel hands.
A rebel fighter who fled the city after nightfall said it still had not fallen.
"They are still bombing it from the air, the sea and with rockets, but the ground forces have not come in," said Mohammed el-Gheriani, carrying a Kalashnikov rifle.
But it appeared that Brega, 70 miles (116 kilometers) farther east, could also be under threat. During the day, a warplane struck an empty area in Brega, which has also largely been evacuated of residents and personnel.
"We need help from the international community, but we just hear promises," said Mohammed Ali al-Zwei, a 48-year-old rebel fighter. "They are doing nothing."
Taking back Ras Lanouf would be a major victory for Gadhafi, pushing his zone of control farther along the coast. His regime has also claimed a victory in the west, saying Wednesday it recaptured Zawiya, the closest rebel-held city to the capital, after a six-day siege. Western journalists in Tripoli were taken late Wednesday to a stadium on the outskirts of Zawiya that was filled with Gadhafi loyalists waving green flags and launching fireworks. But the journalists were not allowed to visit Zawiya's main square, and the extent of government control was not known in the city, located on Tripoli's western doorstep.
Deputy Foreign Minister Khaled Qaid reiterated the government's claim Thursday, reading a military statement that Zawiya had been recaptured at 11 a.m. Wednesday and journalists would be taken Friday to visit the city.
"Now the forces are cleaning the city of the extremist armed militants," Qaid told reporters. He said "the security forces and civilians" had seized weapons and ammunition, including anti-aircraft guns, mortar shells and anti-tank missiles.
At a U.S. Senate hearing, Director of National Intelligence James Clapper said there was no indication that Gadhafi would step down and offer a speedy resolution to the crisis.
"Gadhafi is in this for the long haul," he said. "From all evidence that we have ... he appears to be hunkering down for the duration."
Pressed on which side had the momentum, he was even clearer: "I think in the longer term that the regime will prevail."
Hours later, the White House distanced Obama from Clapper's remarks. Obama does not think Gadhafi will prevail, a senior administration official said, speaking on condition of anonymity to discuss Obama's position on Clapper's comments. The official reiterated Obama's stand that Gadhafi has lost legitimacy and should leave power.
White House spokesman Jay Carney said Clapper has the full confidence of the president.
Western countries appeared to be growing more open in their embrace of the rebel movement. But they were struggling with how to translate that into concrete support.
France said it planned to exchange ambassadors with the rebels' Interim Governing Council after Sarkozy met with two representatives from the group, based in Benghazi.
"It breaks the ice," said Mustafa Gheriani, an opposition spokesman. "We expect Italy to do it, and we expect England to do it."
French activist-intellectual Bernard Henri-Levy sat in the meeting and said France was planning "targeted operations" to defend civilians if the interim council demands them and the international community approves. Henri-Levy did not elaborate and the French government declined to comment, so it was not clear if he was describing a new, more aggressive plan for intervention.
NATO has said it is drawing up plans for a no-fly zone but would only act with the approval of the U.N. Security Council. Britain and France have backed the rebels' calls for a no-fly zone.
But the U.S. showed caution, warning against a go-it-alone approach.
"Absent international authorization, the United States acting alone would be stepping into a situation whose consequences are unforeseeable," Clinton said. "We're looking to see whether there is any willingness in the international community to provide any authorization for further steps."
Clinton said the U.S. was suspending its relationship with Libya's remaining envoys to the country, although the move falls short of severing diplomatic relations. She said she would meet with Libyan opposition figures when she travels to Egypt and Tunisia next week, marking the highest level contact between the U.S. and the anti-Gadhafi elements.
NATO said it had started round-the-clock surveillance of Libyan airspace, and British Foreign Secretary William Hague said a meeting of EU foreign ministers would discuss how to isolate the regime.
U.N. Ambassador Maged Abdelaziz of Egypt expressed serious concern about the more than 1 million Egyptians still in Libya, "and we are afraid that the tragic events that happened in Iraq using human shields to protect air defense systems on the ground would be repeated." He added that he had "no concrete information" about whether that was happening.
Germany said it froze billions in assets of the Libyan Central Bank and other state-run agencies. The U.S., Britain, Switzerland, Austria and other countries have also frozen Gadhafi's assets.
"The brutal suppression of the Libyan freedom movement can now no longer be financed from funds that are in German banks," Economy Minister Rainer Bruederle said.
The Libyan government tried to stave off tough action, sending envoys to Egypt, Portugal and Greece.