"We can defeat any aggression if necessary and arm the people," Gaddafi said, in footage that was aired on Libyan state television on Friday.
"I am in the middle of the people. We will fight … we will defeat them if they want … we will defeat any foreign aggression.
"Dance … sing and get ready … this is the spirit … this is much better than the lies of the Arab propaganda," he said.
The speech, which also referred to Libya's war of independence with Italy, appeared to be aimed at rallying what remains of his support base, with specific reference to the country's youth.
His last speech, on Thursday evening had been made by phone, leading to speculation about his physical condition.
The footage aired on Friday, however, showed the leader standing above the square, waving his fist as he spoke.
Tarik Yousef, a senior fellow at the Brookings Institute in Washington, told Al Jazeera that most of the individuals on Green Square are genuine Gaddafi supporters.
"Most of these people have known nothing else but Gaddafi. They don’t know any other leader. And many of them stand to lose when Gaddafi falls," Yousef said.
"I am not completely surprised that they still think that he is the right man for Libya. What is striking is that [Gaddafi] did not talk about all the liberated cities in his country.
"This was a speech intended show his defiance and to rally against what he calls foreign interference. But even his children have admitted that the east of the country is no longer under the regime's control."
Anti-Gaddafi protesters shot
Gaddafi's speech came on a day when tens of thousands of Libyans in the capital and elsewhere in the country took to the streets calling for an end to his rule.
As demonstrations began in Tripoli following the midday prayer, security forces loyal to Gaddafi reportedly began firing on them. There was heavy gun fire in various Tripoli districts including Fashloum, Ashour, Jumhouria and Souq Al, sources told Al Jazeera.
"The security forces fired indiscriminately on the demonstrators," said a resident of one of the capital's eastern suburbs.
"There were deaths in the streets of Sug al-Jomaa," the resident said.
The death toll since the violence began remains unclear, though on Thursday Francois Zimeray, France's top human rights official, said it could be as high as 2,000 people killed.
Dissent reaches mosques
Violence flared up even before the Friday sermons were over, according to a source in Tripoli.
"People are rushing out of mosques even before Friday prayers are finished because the state-written sermons were not acceptable, and made them even more angry," the source said.
Libyan state television aired one such sermon on Friday, in an apparent warning to protesters.
"As the Prophet said, if you dislike your ruler or his behaviour, you should not raise your sword against him, but be patient, for those who disobey the rulers will die as infidels," the speaker told his congregation in Tripoli.
During Friday prayers a cleric in the town of Mselata, 80km to the east of Tripoli, called for the people to fight back.
Immediately after the prayers, more than 2,000 people, some of them armed with rifles taken from the security forces, headed towards Tripol to demand the fall of Gaddafi, Al Jazeera's Nazanine Moshiri reported.
The group made it as far as the city of Tajoura, where it was stopped by a group loyal to Gaddafi.
They were checked by foreign, French-speaking mercenaries and gunfire was exchanged. There were an unknown number of casualties, Moshiri reported, based on information from witnesses who had reached on the Libyan-Tunisian border.
There have been frequent reports of foreign mercenaries working for Gaddafi against the protesters, but their nationality remains uncertain.
The government of Chad has moved to counter allegations that Chadian mercenaries were being recruited to go to Libya.
"International media inundates the public opinion with information alleging some Chadian would be mercenaries currently acting in Libya," Moussa Mahamat Dago, the Chad foreign ministry’s general secretary, said on Friday.
"We want to formally and categorically deny all those allegations that are dangerous and could pose a material and physical danger to the many Chadians living in Libya for years and always in a peaceful way."
People in eastern parts of the country, a region believed to be largely free from Gaddafi's control, held protests in support for the demonstrations in the capital.
"Friday prayers in Benghazi have seen thousands and thousands on the streets. All the banners are for the benefit of the capital, [they are saying] 'We're with you, Tripoli.'" Al Jazeera’s Laurence Lee reported.
In the town of Derna, protesters held banners with the messages such as "We are one Tribe called Libya, our only capital is Tripoli, we want freedom of speech".
Al Jazeera's correspondent in Libya reported on Friday that army commanders in the east who had renounced Gaddafi's leadership had told her that military commanders in the country's west were beginning to turn against him.
They warned, however, that the Khamis Brigade, an army special forces brigade that is loyal to the Gaddafi family and is equipped with sophisticated weaponry, is currently still fighting anti-government forces.
The correspondent, who cannot be named for security reasons, said that despite the gains, people are anxious about what Gaddafi might do next, and the fact that his loyalists were still at large.
"People do say that they have broken the fear factor, that they have made huge territorial gains,” she said. "[Yet] there's no real celebration or euphoria that the job has been done."
Pro-democracy protesters attacked
On Friday morning, our correspondents reported that the town of Zuwarah was, according to witnesses, abandoned by security forces and completely in the hands of anti-Gaddafi protesters.
Checkpoints in the country's west on roads leading to the Tunisian border, however, were still being controlled by Gaddafi loyalists.
In the east, similar checkpoints were manned by anti-Gaddafi forces, who had set up a "humanitarian aid corridor" as well as a communications corridor to the Egyptian border, our correspondent reported.
UNIQUELY AFRICAN! UNIQUELY YOU!!