Libya's prime minister denied on Thursday giving a deadline for militias to leave Tripoli, saying he preferred negotiation and had already secured the withdrawal of a big armed group.

Tripoli's city council said on Tuesday it was giving militias until December 20 to leave town as part of a new strategy to rid the city of the groups of armed men who toppled Muammar Gaddafi three months ago and have stayed there since.

The two-week-old provisional government has made improving security a priority. Ridding the capital of militias, many of which have come from other towns, is a challenge that will test the new cabinet's power.

We didn't give any deadline, Prime Minister Abdurrahim El-Keib told reporters outside his offices after a meeting with Australian Foreign Minister Kevin Rudd. Asked about the December 20 departure date, he said: That's not my deadline.

The council's Tuesday statement detailing the strategy said it had Keib's support, and the council's head announced the measures at a news conference inside Keib's offices. But Keib said he believed such a confrontational approach was flawed.

Setting a deadline two weeks here (saying) 'Get out or else', it doesn't work like this, Keib said in English.

As part of the city council's strategy, local groups have set up nighttime checkpoints in Tripoli and demonstrations have been held to increase pressure on militias to leave. If they do not, traffic in the city will be halted, the council said.

Keib said that instead of confronting militiamen publicly, he was negotiating with them and a militia group from outside Tripoli had just told him they would leave the city. He declined, however, to say which city's militiamen he meant.

There is a group and you will be surprised, we'll tell you who that group is, a major player in this, a group of freedom fighters coming from another city, said Keib, whose government wants militiamen to join a national army it has yet to create.

Militias from the coastal city of Misrata and the mountain town of Zintan are among the most powerful armed groups inside the Libyan capital. They man roadblocks, roam the city in pick-up trucks and have bases in government buildings.

WHO'S WHO?

Keib said the unnamed militia command he had dealt with had been convinced, not coerced, into pulling out of Tripoli.

It's because we have been talking to them, they understand the situation and they are interested, they have actually expressed themselves, interest to leave the city.

The head of one Misrata brigade said his city's military command had issued an order to all its militiamen to return home. Until he had received written instructions, however, he would continue to maintain security in the capital.

My brigade has been given a task to carry out in Tripoli. We will not abandon our task until we receive a formal letter discharging us of our duties, Mohammed al-Dweili said.

Around 2,000 people attended a protest in Tripoli's Martyrs' Square on Wednesday calling on militias to leave.

Protesters complained of the proliferation of weapons and feeling unsafe in general but they also said some militiamen were behaving like criminals. Keib said troublemakers were posing as former rebel fighters.

Telling legitimate former fighters, who helped bring Gaddafi's 42-year rule to an end, from armed criminals was, however, a difficult task.

When you say people who come from outside Tripoli, what does that mean? I tell you, some of them have been here protecting this city and the things that belong to the government and to the people, he said.

Some, who are not necessarily belonging although they claim to belong to a certain area, are just acting in a manner that is unacceptable, he added.

(Additional reporting by Taha Zargoun)