DEIR AL BALAH, Gaza Strip — It was hours before dawn, and the last Israeli troops and armor had just rolled out of the dust-choked Jewish settlement of Kfar Darom. And there, resplendent in a crisp white shirt and tie, stood the Hamas mayor of the adjoining Palestinian village, busily directing equipment clearing a road that had been closed for years to Palestinian traffic.
Like municipal officials anywhere in the world, Ahmad Kurd, the mayor of Deir al Balah, was eager to showcase his hands-on, in-charge demeanor at a tumultuous moment in his constituents' lives.
But it wasn't just a one-time performance. Devotion to the nitty-gritty details of governance has become a hallmark of mayors and city council members from Hamas, the Palestinian militant group that has made suicide bombings and ambush-style shooting attacks its primary trademarks.
"It is only Hamas that can accomplish things," Kurd said Monday, ignoring clouds of powdery sand rising around him. "This is what we do: We try to make life better for the Palestinian people -- immediately, and on the ground."
With the end of the Israeli presence in Gaza, Hamas is working to position itself as the principal power in the first large swath of territory under Palestinian sovereignty.
Already well ensconced in dozens of town halls across the West Bank and Gaza, Hamas now is gearing up for its next big electoral challenge: winning a substantial block of seats in Palestinian parliamentary elections in January. By all indications, it will easily do so.
In the meantime, the group sees the transition to Palestinian rule in Gaza as a perfect opportunity to outshine the beleaguered and disorganized Palestinian Authority, led by President Mahmoud Abbas.
"The Palestinian Authority has not shown an ability to bring about any kind of stability, or to provide services to the population," said Israeli analyst Gerald Steinberg. "And that certainly plays into the hands of Hamas."
Capitalizing on its reputation for being free of the corruption that beset the Palestinian Authority, Hamas is calling for the efficient and graft-free rebuilding of war-battered Gaza, a message that strikes a chord among ordinary Palestinians.
"They are the ones I trust to work hard and not steal from the people," said Maram Bashir, a round-faced young woman in a tightly fitted black head scarf, who said she would vote for Hamas in the parliamentary elections. She already did so in local elections in Deir al Balah.
Israel strenuously objects to Hamas participating in elections, particularly those that encompass all Palestinian territory, as long as it refuses to renounce its armed struggle or give up its weapons.
Prime Minister Ariel Sharon told reporters in New York during the United Nations summit on Friday that Israel might withhold help for the Palestinian elections if Hamas runs.
Now that it has withdrawn from Gaza, there is little Israel could do there. But the prime minister said Israel could, for example, leave West Bank roadblocks in place.
Palestinian negotiator Saeb Erekat said Saturday that Sharon's comments weakened moderates such as Abbas and helped strengthen Hamas.
"I really urge Mr. Sharon not to interfere in internal Palestinian affairs," Erekat said.
"The turning point in Palestinian history is these elections.... This is the road. This is the first step to put Palestinians on the right track. Such statements from Mr. Sharon only complicate this and weaken us."
Hamas said it was determined to run despite Sharon's comments and warned against interference.
The issue of Hamas running in the elections is likely to come up in a meeting between Sharon and Abbas that is tentatively scheduled for the first week of October.
The Bush administration, together with British Prime Minister Tony Blair and other leaders, supports Israel's demand that Hamas disarm, but in general believes that attempts to keep the group out of politics would backfire, Western diplomats said.
Abbas has said he intends to disarm not only Hamas, but also all Palestinian factions except his own security forces.
But he and senior aides say it is up to the Palestinian government, not Israel, to decide when and how this might take place.
"We're not going to go to a civil war over this," said Abbas' information minister, Nabil Shaath.
In Gaza, Abbas faces a conundrum. Any prolonged period of calm helps bolster his standing, both domestically and internationally. But militant groups such as Hamas, sometimes acting in concert with criminal gangs, can easily orchestrate an outbreak of chaos at any moment through street battles, abductions or brazen, high-profile killings like the assassination this month of former security chief Moussa Arafat.
Hamas staged massive marches last week to celebrate Israel's military withdrawal from Gaza, drawing far larger crowds than the rallies sponsored by the Palestinian Authority.