The top Republican on the Senate Armed Services Committee made the remark after arriving in Benghazi, a city that has been the opposition capital in the rebel-held eastern Libya.
McCain said he was in Benghazi "to get an on the ground assessment of the situation" and planned to meet with the rebel National Transition Council, the de-facto government in the eastern half of the country, and members of the rebel military.
"They are my heroes," McCain said of the rebels as he walked out of a local hotel in Benghazi. He was traveling in an armored Mercedes jeep and had a security detail. A few Libyans waved American flags as his vehicle drove past.
McCain's visit is the highest yet by an American official to the rebel-held east and a boost to the anti-Gadhafi forces. Details of the trip were shrouded in secrecy due to heightened security in a country fiercely divided by the two-month-old anti-Gadhafi rebellion.
McCain's trip comes as Defense Secretary Robert Gates announced Thursday that President Barack Obama has authorized armed Predator drones against forces loyal to Gadhafi. It is the first time that drones will be used for airstrikes since the United States turned over control of the operation to NATO on April 4.
The rebels have complained that NATO airstrikes since then have largely been ineffective in stopping Gadhafi forces.
Invoking the humanitarian disasters in Rwanda and Bosnia in the 1990s, McCain pressed for U.S. military intervention in Libya in February, weeks before the U.N. Security Council authorized military action to protect civilians and impose a no-fly zone.
When Obama acted with limited congressional consultation, McCain - who was the 2008 Republican presidential contender running against Obama - defended the president, saying he couldn't wait for Congress to take even a few days to debate the use of force. If he had, "there would have been nothing left to save in Benghazi," the rebels' de-facto capital.
But as the U.S. handed operational control over to NATO - and withdrew U.S. combat aircraft - McCain criticized the administration.
"For the United States to withdraw our unique offensive capabilities at this time would send the wrong signal," McCain said. He said the U.S. must not fail in Libya and said he spoke as someone experienced in a lost conflict, a reference to his time as a prisoner of war in Vietnam, where he served as a Navy pilot.
McCain also has pushed for arming the rebels, saying the U.S. and its partners cannot allow Gadhafi to consolidate his hold on one section of the country and create a military deadlock.
Donna Cassata in Washington contributed to this report.