There is no water, scarcely any gas or fresh food, and only intermittent power, but Tripoli’s heart is slowly beginning to beat again.

Streets in the Libyan capital were mostly quiet Saturday, and there were no signs of snipers as the city’s new rulers eliminated a last pocket of loyalist resistance on the road to the international airport.

Every day, security has improved, and many here appear to be allowing themselves to finally believe they have thrown off the weight of 42 years of dictatorship.

“This is a sensation that I never felt before,” said Abdul Munam el-Zurgani, a doctor and medical supplies importer who was born in 1971, a little more than a year after Moammar Gaddafi took power. “Even though there is no water and no electricity, we are very grateful, first to God, but also to the outside world that helped our cause.”

The rebels said they took control of the Ras Ajdir border crossing into Tunisia on Saturday and will soon reopen the main supply route to Tripoli. Loyalist troops are still shelling a portion of the road near the city of Zuwarah, 75 miles west of Tripoli, but should be flushed out soon, said Mahmoud Shammam, the information minister in the rebel’s transitional council.

Officials are also hoping to restart operations at the large refinery in Zawiyah, 30 miles west of Tripoli, by Monday and restore the water supply in the capital. The rebels had shut off water supplies because of rumors Gaddafi had poisoned the water, and tests are still under way to ensure this is not the case.

Meanwhile, some members of the rebel council have moved to Tripoli, and its most senior leaders are expected soon. The challenges they face are enormous, and they are already warning they cannot perform miracles.

Hospitals are still full to bursting, and many medicines are in short supply. Doctors have been working nonstop for weeks on a flood of casualties from the fighting, initially wounded pro-Gaddafi soldiers and now mainly rebels.

“It is chaos,” said Aladdin Ben Ramadan, the head neurosurgeon at the Shara al-Zawiyah Hospital. “We have shortages of everything, including paramedics, medics and nurses.”

Unlike the more well-educated and middle-class doctors, many of the nurses were pro-Gaddafi and have not reported to work this week, presumably out of fear, doctors said.

“We are waiting for the airport to open in order to be able to bring more relief in,” said Robin Waudo of the International Committee of the Red Cross. “We are trying to understand how the new government functions, but that has been difficult.”

Reestablishing a police force is also a pressing task, and officials want to avoid the mistakes of post-Saddam Hussein Iraq, where the de-Baathification process of ridding the government of Hussein loyalists left an administrative vacuum.

But police stations throughout the city have been burned and looted.

In one office, a captain’s uniform still lay on his chair, his shirt, tie and shoes at one side, as though he had hurriedly changed into civilian clothes before fleeing.

Gunmen man checkpoints every few yards, some with lists of license plate numbers of cars owned by Gaddafi loyalists, and young excitable men still fire their weapons into the air far too frequently for many people’s comfort. Nevertheless, 34-year-old Amal Mohammed said she was surprised that the young rebels were behaving so well.

“Gaddafi kept telling us the rebels were very bad,” she said as she shopped for some meat for her children. “But actually they have been very polite and considerate. Thank God, now we can smell our freedom.”

Throughout the city, neighborhoods are beginning to organize and help each other, sharing food and even money and fetching small tanks of water to distribute supplies.

“Everybody is smiling, and we are supporting each other,” said Khaled Faroun, a 50-year-old engineer. “We have to pay something for this, but now we know we have a future for our children.”

In one neighborhood, young men sitting at laptops were issuing identity cards for people and recording what weapons they have. Officials say they hope these records will later help them collect the weapons, addressing a key concern of many civilians here. But long as the list of concerns is, many people say the freedom to speak freely makes the hardships worthwhile.

“I want to say ‘I like this, and I don’t like that,’ ” said Emad Abushagur, a 36-year-old accountant whose cousin works for NASA and who picked up a gun for the first time this week to protect his neighborhood and his family. But he has another dream, too: “I want to go to America. I want to see the Los Angeles Lakers, and see Kobe Bryant.”

Correspondent Thomas Erdbrink contributed to this report.