KABUL (NYTIMES) - Last month, when the Taleban took the district of Imam Sahib in Afghanistan's north, the insurgent commander who now ruled the area had a message for his new constituents, including some government employees: Keep working, open your shops and keep the city clean.
The water was turned back on, the power grid was repaired, garbage trucks collected rubbish and a government vehicle's flat tyre was mended - all under the Taleban's direction.
Imam Sahib is one of dozens of districts caught up in a Taleban military offensive that has swiftly captured more than one-quarter of Afghanistan's districts, many in the north, since the United States withdrawal began in May.
It is all part of the Taleban's broader strategy of trying to rebrand themselves as capable governors while they press a ruthless, land-grabbing offensive across the country. The combination is a stark signal that the insurgents fully intend to try for all-out dominance of Afghanistan once the US pullout is finished.
"The situation is such that it is a testing period for us. Everything done in practice is being watched," Mr Sirajuddin Haqqani, the Taleban deputy commander and the head the group's most violent wing, said in a recent radio broadcast to Taleban fighters. "Behave in a good way with the general public."
But the signs that the Taleban have not reformed are increasingly clear: An assassination campaign against government workers, civil society leaders and security forces continues on pace. There is little effort to proceed with peace talks with the Afghan government, despite commitments made to the US.
And, in areas the insurgents have seized, women are being forced out of public-facing roles, and girls out of schools, undoing many of the gains from the past 20 years of Western presence.
For much of the Afghan public, terrified and exhausted, the Taleban's gains have been panic-inducing. And there is widespread fear that worse is in store, as the Taleban already have several crucial provincial capitals effectively under siege.
Regional groups have begun to muster militias to defend their home turf, sceptical that the Afghan security forces can hold out in the absence of their US backers, in a painful echo of the country's devastating civil war breakdown in the 1990s.
In places they now rule, the Taleban have imposed their old hardline Islamist rules, such as forbidding women from working or even going outside their homes unaccompanied, according to residents in recently captured districts. Music is banned. Men are told to stop shaving their beards. Residents are also supposed to provide food for Taleban fighters.
Documents and interviews with insurgent commanders and Taleban officials show that the success of the group's recent surge was not entirely expected, and that Taleban leaders are haphazardly trying to capitalise on their sudden military and political gains.
Districts were not always taken through sheer military force. Some fell because of poor governance, others because of rivalries between local strongmen and low morale among the security forces.
Internally, the message from Taleban leadership to its fighters is that even though they have seen an increase in casualties, they are winning their battle against the Afghan government as international forces depart.
More than 1,600km away in Qatar, peace talks between the Afghan government and Taleban representatives have made little headway, with the two sides meeting infrequently.
For now, the Taleban are focusing their energy on improving their image in places they have taken control. Success is not a given: The group's governance record during their time in power before 2001 was poor. Services lagged, public displays of brutality were common, and fear was rampant.
In one northern Afghan district, the area's new Taleban ruler went straight to the bottom line, trying to persuade residents they would not be killed out of hand.
"Everyone's life is safe," Mr Najibullah, a local resident who requested to use only his first name for his protection, recounted the commander saying from the town square. But, Mr Najibullah added: "People are scared, and they are uneasy."
As the Taleban gain ground, fighters have directions to treat captured government soldiers with care and ultimately release them. They have also been told to lay siege to larger provincial capitals on their outskirts, but not enter them. In places like Imam Sahib, some civil servants are being allowed to return to work - except for women - to help keep towns and cities functioning, although it is unclear who is paying them.
These directives are clearly aimed at avoiding bad publicity - destroyed homes, dead civilians and damaged public works - and at least appear to adhere to the US-Taleban agreement made last year. The deal outlined certain military tactics that both sides would refrain from, including attacking provincial capitals.
But adherence to the deal was seemingly ignored when Taleban fighters entered not one, but several provincial capitals in recent weeks, with fighting reported in the streets and dozens of soldiers and civilians killed and injured, and untold amounts of property destroyed.
Reports of insurgent fighters enacting revenge on the local population have also surfaced, signalling the limited ability of Taleban leaders to control their assortment of ground commanders - all of different ethnicities, diverging loyalties and unclear levels of adherence to the group's command structure.
A Taleban commander who was not authorised to speak to the media told The Times that although he was not cleared to assault Kunduz city, a provincial capital in the north, his forces saw an opportunity and took it - a move that senior leaders later endorsed.
Now after weeks of fighting, Afghan government forces, propped up by aerial bombardments and an influx of the Afghan military's elite commandos, have pushed the Taleban back to some parts of the city's edge. But it remains surrounded.
Dozens of civilians and soldiers have been killed, hundreds more wounded and more than 40,000 have been displaced around Kunduz province, according to a July 1 United Nations report. Some homes there were burned down by the Taleban, residents said.
On the battlefield, things are shifting quickly. Thousands of Afghan soldiers and militia members have surrendered in past weeks, forfeiting weapons, ammunition and armoured vehicles as the Taleban take district after district. Government forces have counterattacked, recapturing several districts, although not on the scale of the insurgents' recent victories.
But little reported are Taleban losses, aside from the inflated body counts announced by the Afghan government's Ministry of Defence. The Taleban, with their base strength long estimated to be between 50,000 and 100,000 fighters, depending on the time of year, have taken serious casualties in recent months, especially in the country's south.
The casualties are primarily from the Afghan and US air forces, and sometimes from Afghan commando units.
Mr Mullah Basir Akhund, a former commander and member of the Taleban since 1994, said that cemeteries along the Pakistani border, where Taleban fighters have long been buried, are filling up faster than in years past.
Pakistani hospitals, part of the country's unwavering line of support for the insurgents, are running out of bed space. During a recent visit to a hospital in Quetta, a hub for the Taleban in Pakistan, Mr Akhund said he saw more than 100 people, most of them Taleban fighters, waiting to be treated.
But despite tough battles, the weight of a nearly withdrawn superpower, and the Taleban's own leadership issues, the insurgents continue to adapt.
Even as they seek to conquer the country, the Taleban are aware of their legacy of harsh rule, and do not want to "become the same pariah and isolated state" that Afghanistan was in the 1990s, said Mr Ibraheem Bahiss, an International Crisis Group consultant and an independent research analyst.
"They're playing the long game," Mr Bahiss said.