Tripoli, Libya (CNN) -- In his first visit to Libya since the fall of Moammar Gadhafi, Sen. John McCain hailed that nation's revolution as the showcase for the so-called Arab Spring but acknowledged a tough road lay ahead.
"The Libyan people have inspired the world," McCain said. "They have turned cynics into supporters."
But he cautioned that Libya's new leaders have "a lot of work to do" and will face challenges in unifying the nation as they move forward.
McCain, the ranking member of the U.S. Senate Armed Services Committee, had been a strong proponent of increasing military stakes to oust Gadhafi. He said he had dreamed of this day, of returning to a liberated capital. He had received a hero's welcome when he visited Benghazi back in April, when war was still raging and no one knew with certainty whether rebel forces would succeed.
Thursday, McCain toured a very different Libya. In Tripoli with fellow Republican Sens. Marco Rubio of Florida, Lindsey Graham of South Carolina and Mark Kirk of Illinois, the senators met with members of Libya's interim governing council, military commanders and ordinary Libyans.
They also visited one of Libya's main prisons. McCain, who was a prisoner of war in Vietnam, said he wanted to see how prisoners were being treated.
Despite overcrowding and a backed-up judicial system, McCain said he found it encouraging that the new leadership had allowed the Americans inside the facility.
McCain said concerns remained over the possibility of an extremist government coming to power but that the United States would provide any help needed to conduct free and fair elections.
"The United States will be prepared to cooperate with any government that Libyan people decide on,' McCain said. "Obviously, our relations will be affected with the kind of government that is, I do not claim to be an expert on Libya, but I do know that the people of Libya are not in any significant numbers interested in a radical Islamic government such as the one in Iran."
The senators assured the new Libyan leadership of support from the United States in the form of trade and said they would work to thaw the assets freeze imposed under Gadhafi.
Graham also praised the "courage and bravery" of the Libyans but warned that liberation from Gadhafi was not complete.
"The Gadhafi regime is history, but the war is not over," Graham said. "Before the day is over some young Libyan will lose his life, people are dying and the fighting continues as I speak."
Battles are still raging in Bani Walid, Sabha and Gadhafi;s birthplace of Sirte, where the strongman's supporters have put up stiff resistance to the revolutionary forces,
Gadhafi's whereabouts are still unknown, though the interim council reported Wednesday that he was somewhere near the western border town of Ghadamis.
McCain said Libyans he spoke with told him they would like to see Gadhafi captured alive so that he can be brought to justice for his alleged crimes.
"There is no doubt this guy was hated by the people of Libya and I think they'd like to see him brought to justice more than they'd like to see him dead," McCain told CNN.
To that end, McCain said the United States "will assist in the way we are capable" in capturing Gadhafi.
"But I can't discuss it further," he said.