TRIPOLI, Libya — The leaders of Britain and France visited Libya on Thursday in a triumphal but heavily guarded tour intended to boost the country’s revolutionary leaders, whose forces were propelled to power with NATO’s help last month by routing Col. Muammar el-Qaddafi and his military in the most violent conflict of the Arab Spring uprisings.

Prime Minister David Cameron of Britain and President Nicolas Sarkozy of France, who convened an international meeting two weeks ago in Paris in support of the new Libyan authorities, were the first world leaders to travel to the Libyan capital in the post-Qaddafi era. They pledged to keep up the NATO bombing — which their countries supervised — until the last of the recalcitrant Qaddafi forces surrendered. They also promised to help track down the elusive Colonel Qaddafi, and to provide political and economic aid to the new leaders seeking to fill the void left by his four decades of absolute rule.

The Cameron-Sarkozy visit, which also included a stop in the eastern city of Benghazi, where both were greeted warmly by residents, came as anti-Qaddafi forces claimed they had punched holes in the loyalist defenses surrounding the Mediterranean enclave of Surt, Colonel Qaddafi’s tribal hometown and one of the redoubts of support for him.