TRIPOLI — Libya's revolution has "inspired the world" but the country faces huge challenges, including the mass proliferation of weapons, US Senator John McCain said on a visit to Tripoli on Thursday.

"The Libyan people have inspired the world.... We believe strongly that the people of Libya today are inspiring the people in Tehran, in Damascus and even in Beijing and Moscow," McCain told a news conference in Tripoli, where he was part of a Republican congressional delegation in the highest-profile US visit since the ouster of Moamer Kadhafi last month.

"We have confidence in this government and this council (the National Transitional Council)," he added.

"But we also recognise, as they do, that this is a rocky road; this is a difficult path and they face many obstacles, and one of them of course is that the various militias be brought under government control.

"It's essential to continue working together to secure the many weapons and dangerous materials that the Kadhafi regime proliferated around this country," said the Arizona senator.

McCain and senators Lindsey Graham of South Carolina, Mark Kirk of Illinois and Marco Rubio of Florida met with senior officials from the NTC and military commanders, and visited Martyr's Square in Tripoli.

Kirk said Libya's revolution would stand as an example to other regimes, in particular to President Bashar al-Assad of Syria, where the United Nations says a crackdown on opposition protesters has killed more than 2,700 people.

"What happens in Libya has worldwide significance and it especially says to the Assad dictatorship in Syria: You may be next," he said.

With NTC forces in Libya still fighting to take two last bastions of Kadhafi support, Sirte and Bani Walid, McCain said it was important to bring the war to a "dignified and irreversible end."

Graham also warned over the huge number of loose weapons that were raided from Kadhafi's enormous stockpiles.

"This country has a very bright future. But there are faultlines," Graham said. "When this war is finally over, someone has to convince the militias to lay down their guns and follow the rule of law."

He said securing weapons had been "a very big topic" of discussions.

"I feel more confident than I did before the trip that we have a game plan to secure the weapons caches, in particular biological and chemical weapons," he said.

McCain said the senators had "very constructive meetings" with NTC chief Mustafa Abdel Jalil and interim prime minister Mahmud Jibril.

The senators said they had also raised the issue of the 1988 Lockerbie bombing and were confident Libya would cooperate in further investigations.

"We have some confidence that the Libyan government knows how important this issue is to the American people," McCain said.

"I see no reason why we will not see cooperation on the part of the Libyan government... We would like to know who else is connected with it (the bombing)," he added.

Britain and the United States are pressing Libya's new regime for cooperation in further investigations into the bombing, which saw a Pan Am jumbo jet explode over the Scottish town of Lockerbie on December 21, 1988, killing 259 people on the plane, mainly Americans, and 11 on the ground.

Libya's interim justice minister said this week the new authorities were "ready to cooperate" after a request from prosecutors in Scotland.

The only person convicted of the bombing, Libyan Abdelbaset Ali Mohmet al-Megrahi, was released on compassionate grounds on August 20, 2009 after doctors said he had only three months to live. He is still alive.