Thousands of Libyans have turned out to cheer UK Prime Minister David Cameron and French President Nicolas Sarkozy in the eastern city of Benghazi.
"It is great to be in free Libya," Mr Cameron said. "Col Gaddafi said he would hunt you down like rats, but you showed the courage of lions."
The two leaders pledged support for the interim authorities.
Meanwhile, anti-Gaddafi fighters say they have entered Sirte, one of the last cities loyal to the ousted leader.
A spokesman for the National Transitional Council (NTC) told the BBC that NTC fighters have breached lines of defence on the south and west of Sirte.
The fighters - made up of battalions from Misrata, 200km (120 miles) to the west - are about 8-10km from the city centre, the spokesman said.
They have been facing fierce resistance and have been forced to withdraw a couple of kilometres in order to treat casualties, he added.
After the talks in Tripoli, Mr Cameron and Mr Sarkozy travelled under heavy security to Benghazi, where a crowd had gathered in central Liberty Square, waiting to hear them speak.
Shouting to make himself heard above the roar of welcome, Mr Cameron told his audience : "Your friends in Britain and France will stand with you as you build your country and build your democracy for the future."
Mr Sarkozy plunged into the crowd, reaching across his bodyguards to shake the hands of waiting Libyans, many of them waving French flags.
This is the first visit to Libya by Western leaders since ex-leader Col Muammar Gaddafi was overthrown last month.
Earlier, Mr Cameron praised the NTC for the way it has established control over the country, but warned that the "hardest part" was still to come.
Both he and Mr Sarkozy said Nato would continue its mission under a UN mandate to protect Libyan civilians until the last remnants of pro-Gaddafi forces were defeated. Britain and France were at the forefront of the Nato operation in Libya.
"The message, I think, to Gaddafi and all those holding arms on his behalf is: it is over. Give up. The mercenaries should go home," Mr Cameron told a news conference in Tripoli.
NTC chief Mustafa Abdul Jalil thanked them for taking "brave positions" during the Libyan uprising.
"They showed us political, economic and military support which helped the rebels establish a state, and we thank France and the UK for that," he said.
Mr Sarkozy urged Libyans to avoid "vengeance and retaliation", calling on them to preserve unity and seek reconciliation.
He said France's focus was on consolidating the position of the NTC and pursuing the last remnants of the Gaddafi regime, rather than focusing on economic deals or reconstruction contracts.
However, Mr Abdul Jalil said Libya's allies would get some priority when future contracts are negotiated.
Mr Cameron and Mr Sarkozy arrived in Libya earlier on Thursday and flew by helicopter to a hospital where they were greeted by crowds of cheering staff and patients.
The two leaders are hugely popular in Libya, where common graffiti slogans include: "Merci Sarkozy!" and "Thank you Britain!"
Mr Cameron, who is accompanied by UK Foreign Minister William Hague, has announced that Britain is to:
- deploy a UK military team to advise the NTC on security
- return Libyan assets totalling £600m ($948m) to the interim authorities as soon as possible
- make 50 places available in UK specialist hospitals for critically ill Libyans, with visa requirements to be waived for patients and one accompanying person
- provide £600,000 for de-mining efforts and £60,000 to pay for a police communications system
The UK has also relaxed its advice for Britons wanting to travel to Libya, saying essential travel to Tripoli, Benghazi and some other cities is now possible.
On Friday, the NTC is to send a delegation to neighbouring Niger in an effort to recover gold and cash believed to have been taken out of Libya by fleeing Gaddafi loyalists. Mr Sarkozy and French Foreign Minister Alain Juppe will also meet Niger's leadership on Friday.
"Impunity is over," Mr Sarkozy said.
At least 36 members of the fugitive leader's inner circle, including relatives and generals, have fled to neighbouring Algeria and Niger since Tripoli fell to NTC forces last month.
Mr Abdul Jalil said Libya would also ask for the handover of individuals wanted by the International Criminal Court (ICC). The ICC has indicted Col Gaddafi, his son Saif al-Islam and his intelligence chief for crimes against humanity.