By ANTHONY SHADID; Ibrahim Badawy contributed reporting from Darnah, and David D. Kirkpatrick from Tripoli, Libya.

Published: March 8, 2011

DARNAH, Libya -- This fiercely independent port city on the Mediterranean coast, once the center of a simmering Islamist insurgency in the 1990s, is now branded by Col. Muammar el-Qaddafi as an Islamic emirate infiltrating his embattled country.

The charge, uttered again on Monday by Libya's foreign minister, is familiar in the Arab world, where strongmen have long presented a stark choice to their subjects and their American backers: either dictatorship or Islamists, repression or chaos.

But Darnah offers a more complex reality: a m?nge where secular currents are intersecting with religious ones, drawn together by nationalist opposition to Colonel Qaddafi's four decades of often bizarre rule. This old Barbary port, with a reputation as one of Libya's most pious cities and, in the words of a WikiLeaks cable, a ''wellspring for foreign fighters in Iraq,'' suggests a more nuanced picture of what role militant Islam may play in a city and country fumbling to forge a body politic in a land without one.

No one knows what will emerge in Libya, or in Egypt or Tunisia for that matter. But so far in each place, in a remarkable legacy of the uprisings, Islamist groups are collaborating with secular counterparts to call for democratic constitutions and the rule of law. Both groups seem to believe pluralism, if won, may best guarantee their survival.

A veteran of the war in Afghanistan, imprisoned for years by Colonel Qaddafi's government, who praises Osama bin Laden's ''good points,'' but denounces the 9/11 attacks on the United States, runs Darnah's defenses, and no one seems all that frightened by him. A secular leader of the impromptu City Council has welcomed the stand of clerics here. Young Islamists mingle with elderly diplomats at the Sahaba Mosque, plotting the revolt that for now has focused not on competing agendas, but on what kind of state might emerge.

Across the region, Islamists demonstrate a new-found sensitivity to how the West views them. They claim to be part of a national struggle and are careful in the words they choose. It is the case even in Libya, one of the world's most isolated places, though far less so than 15 years ago.

At the mosque, Al Jazeera was on throughout the day, and the Internet has brought an alternative to the mind-numbing propaganda of state television. ''There's a change in the mind-set, and that's more important than the revolution,'' said Ashour Abu Rashed, a lawyer and one of Darnah's three transitional leaders.

As with many cities in eastern Libya, Darnah still bears the scars of Colonel Qaddafi's brutality, in particular the notorious massacre at Abu Salim prison in Tripoli in June 1996, when human rights advocates say as many as 1,200 inmates were killed. Nearly 100 were from Darnah, and their portraits paper the stucco walls of the Sahaba Mosque.

So do pictures of five men killed Feb. 17, whose deaths ignited the revolt here. ''It was like a flame skipping from place to place,'' said Sirraj Shinnib, a professor of linguistics at Omar Mukhtar University. ''This place had simmered for 20 years.''

In Darnah, there is at least a passing resemblance to the aftermath of the American invasion of Iraq in 2003. Tribes and clerics emerged forcefully after authority collapsed, especially in more conservative regions.

Here, leaders of tribes like the Obeidat, Zliten, Tajjoura and Misratah already exercise authority, along with judges and a three-member council: Mr. Abu Rashed, a judge and a former diplomat, all secular figures.

Other than them, only the Muslim Brotherhood and more militant strands thought to number in the hundreds show signs of organization, many having forged bonds in prison or fighting the government in the 1990s. One of those men is Abdul-Hakim al-Hasidi, who fought for five years in Afghanistan, ended up in Colonel Qaddafi's jails for four years and now, with hundreds of armed men, runs the defenses of Darnah and its hinterland.

He helps run much of the city's rump bureaucracy as well, drawing on a formidable talent for logistics recognized by many in the town.

''If I answered every call, I'd be talking on the phone even if I was in the bathroom,'' Mr. Hasidi joked, as he ignored a cellphone that rang incessantly.

Since the revolt began, he has fought in the town and in Brega, down the coast, and said he had helped secure hundreds of Kalashnikov rifles for the fight. But he disavows any political ambition, and it is a refrain of him and others that Libya could never be a Taliban-like state.

''Impossible,'' he quipped.

''People are already Muslims, and we don't need an Islamic state to tell us that,'' he added. ''If I had extremist thoughts, then people wouldn't have sided with me.''

Libyan officials have singled out Mr. Hasidi as the head of a supposed emirate here, part of the government's narrative that militant Islamists have hijacked the revolt.

''This group is now leading the military operations,'' Foreign Minister Moussa Koussa said Monday. ''Where did they come from? They came from Al Qaeda.''

Mr. Hasidi laughs at the charge. He promised to lay down his arms once victory is won and return, he said, to teaching.

Secular figures here were adamant in endorsing the Islamists' right to form parties and, at the Sahaba Mosque, slogans were markedly bereft of religious sentiment. ''Freedom, dignity and national unity,'' read one.

A leaflet circulated there pronounced demands almost identical to those uttered in Egypt: a transitional government, a constitution approved by referendum, parliamentary and presidential elections and a democratic state built on pluralism, the peaceful transfer of power, the rule of law and guarantees of human rights and the protection of freedoms.

Mr. Abu Rashed, who is 66, called his generation ''the generation of fear.''

''In the shadow of a new democratic system, everyone should now have their space, and every opinion should be heard,'' he said. ''In the end, there will be dialogue.''

Next to him was a cleric, Shukri Abdel-Hamid, who had spent 10 years in prison.

''We want a civil state, pluralism, with freedom enshrined by law,'' he said, before echoing a sentiment heard often in Egypt and Tunisia. ''Extremism was a reaction to oppression and the violence of the state. Give us freedom and see what happens.''

Libya's rebellion is young, and some residents warned that Islamists may grow more radical the longer it lasts. Some at the mosque warned that foreign intervention in the conflict would be resisted. But in the town, it was tribal divisions that seemed to frighten people more than the longstanding secular and religious divide.

''There are some Islamists here, but so what,'' said Marwan Saud, a pharmacist. ''Let them form a party and then we'll see. That's their right, the freedom to speak.''

PHOTO: Children playing on domes atop Sahaba Mosque in Darnah, Libya, on Saturday. Known as a pious city, it is a complex mix of the religious and the secular. (PHOTOGRAPH BY ED OU FOR THE NEW YORK TIMES)
MAP: Eastern Libya has led the revolt against the government.