A top Libyan security official apparently defected Monday, deepening the isolation for Moammar Gaddafi as a rebel advance threatened to place a stranglehold on the Libyan capital, Tripoli.

Gaddafi, who has kept his grip on power amid a six-month-long rebel uprising and nightly NATO bombing raids, finds himself at perhaps the most precarious point of his nearly 42-year reign.

Rebel leaders said that over the weekend they had wrested control of the strategic coastal city of Zawiyah, which lies between Tripoli and the Tunisian border. Even as Gaddafi loyalists fought back in Zawiyah on Monday, the rebels claimed to have captured two nearby towns, putting within their reach the coastal road that has become the capital’s most important lifeline.

“If that road is cut off, then Tripoli is slowly going to be strangled to death,” said George Joffe, a Libya expert at Cambridge University. “This may be the beginning of a prolonged fight. . . . It’s not yet the killer blow.”

Gaddafi, the Arab world’s longest-ruling autocrat, has vowed to fight until the death. He and his loyalists have showed remarkable resiliency and ruthlessness in combating a rebel force that controls the eastern half of the country as well as the mountainous region to Tripoli’s southwest.

But his inner core of aides has shown signs of breaking apart, and on Monday morning one more crack emerged when his deputy security chief, Nasser al-Mabrouk Abdullah, arrived in Cairo with his family, according to officials in Egypt’s Interior Ministry. Abdullah’s apparent defection is the latest in a series that have eroded Gaddafi’s strength.

The reports from Libya buoyed hopes in the Obama administration, which has recognized the rebel government and has repeatedly called for Gaddafi to leave the country. State Department officials were particularly cheered by Abdullah’s apparent defection, though there had been no official contact with the Libyan security official or independent confirmation of his intentions.

“Senior members of [Gaddafi’s] government seem not to want to stand with him in Libya but are voting with their feet,” State Department spokeswoman Victoria Nuland told reporters in Washington.

Nuland also hailed rebel military successes in towns west of Tripoli and said pressure was mounting on Gaddafi loyalists, although the autocrat showed no signs of stepping down.

In an audio recording broadcast on state television Monday, Gaddafi denounced NATO, calling the alliance “colonizers” who support rebels, whom he disparaged as “rats.” Gaddafi called on his forces to “prepare for battle.” NATO has been carrying out airstrikes against his forces since March, obliterating hundreds of targets across the country.

Dialogue in Tunisia

The opposition victories of recent days came as leaders of the rebel Transitional National Council met for talks with Gaddafi’s representatives in Tunisia. It was the latest in a series of such meetings, though U.S. officials sought to play down expectations that a negotiated settlement might be imminent.

The talks were being coordinated by Abdul-Illah Khatib, a former Jordanian foreign minister who was appointed in March by U.N. Secretary General Ban Ki-moon as a special U.N. envoy to Libya.

Besides Zawiyah, which lies 27 miles west of Tripoli, rebel fighters said they captured the nearby towns of Sorman and Sabrata. Gaddafi forces were reportedly still in charge of the oil refinery near Zawiyah, and it was unclear who was in control of the coastal road to the border.

The advances marked the closest that the rebels have come to the capital. Rebels in Libya’s east, who operate out of their de facto capital, Benghazi, have suffered embarrassing and bruising setbacks when they have advanced too far, too fast. Their counterparts in the western mountains, however, have for the most part managed to hold on to the ground they have won.

But even if the rebels were to hold on to Zawiyah, it remained unclear when the conditions for the fall of Tripoli could materialize. There have been few meaningful signs that residents of the capital, who were the target of a crackdown during the early days of the uprising, are ready to revolt, said Geoff Porter, an analyst at North Africa Risk Consulting.

“The rebels’ military capacity and their ability to fight is getting better, but strategically they are still pretty disorganized,” he said. “Without taking Tripoli, there’s not as much impetus for Gaddafi to leave. He won’t leave voluntarily, and the rebels won’t be able to take Tripoli. It doesn’t seem we’re at the breaking point.”

‘Tightening the leash’

The arrival of Abdullah, the security official, in Cairo was shrouded in secrecy. Late Monday, he was hunkered down in an unidentified Cairo hotel, and Libyan opposition leaders in the Egyptian capital said they had yet to meet with him.

Abdullah “can’t talk to anyone right now because he is afraid someone will kill him,” said Yassin al-Samalousi, a leading Libyan opposition figure in Egypt. “He caused the deaths of so many Libyans, and he is afraid one of the rebels will try to assassinate him.”

But Samalousi also welcomed the apparent defection as an indicator that Gaddafi’s rule was nearing an end. “The rebels are tightening the leash around [Gaddafi’s] neck,” he said. “He is now surrounded, and Gaddafi has no way out except the sea, and NATO is firing from the sea.”

Saleh al-Obeidi, who defected from the Libyan security forces at the start of the uprising in February and is with the opposition, called Abdullah “one of the butchers in the inner Libyan gang.”

Obeidi said that anyone with blood on his hands would be held accountable in a Libyan court.

“Money can be forgiven,” Obeidi said. “But if you’ve killed, then the opposition will not accept you.”

Special correspondent Ingy Hassieb in Cairo and staff writer Joby Warrick in Washington contributed to this report.