BARAKI BARAK, Afghanistan—In one of the last night raids of the Afghan war, government commando units backed by combat aircraft descended after dark last month on a cluster of mud-brick villages in a fertile valley of Logar province south of Kabul.

The commandos from so-called Zero units, one of the few parts of the Afghan republic’s military that hadn’t disintegrated at the time, broke gates into family compounds, detaining several local men. A handful of others were injured by the aircraft providing close support. Eighteen...

BARAKI BARAK, Afghanistan—In one of the last night raids of the Afghan war, government commando units backed by combat aircraft descended after dark last month on a cluster of mud-brick villages in a fertile valley of Logar province south of Kabul.

The commandos from so-called Zero units, one of the few parts of the Afghan republic’s military that hadn’t disintegrated at the time, broke gates into family compounds, detaining several local men. A handful of others were injured by the aircraft providing close support. Eighteen cows were killed in the Aug. 10 raid, villagers say, motorbikes were burned, and an 800-year-old Muslim shrine was badly damaged.

“We were civilians, not supporting either side. Just poor people,” said Noor Rahman Khalili, a 45-year-old farmer whose leg was injured when his home was hit by the aircraft and who now walks with a crutch. “Our house got destroyed and we have lost everything,” he said.

Mr. Khalili’s 21-year-old son, who suffered more serious injuries, is still in a Kabul hospital. The family has had to borrow 100,000 afghanis, or $1,180, a giant amount in rural Afghanistan, from fellow villagers for medical treatment and other costs, Mr. Khalili said.

Under Taliban rule, girls continue going to school and barbers advertise their latest styles on the main street of the Baraki Barak district center.

Photo: Yaroslav Trofimov/The Wall Street Journal

On Aug. 15, days after that night raid in Baraki Barak, the Afghan republic collapsed and the victorious Taliban marched unopposed into Kabul. The metropolis of six million people was spared the kind of destruction that wrecked countless villages and several smaller cities in the past two decades.

For many in the Afghan capital and other big cities, particularly women and those who had worked with the U.S. and allies, the Taliban triumph meant the disappearance of hard-won freedoms and a personal threat. More than a hundred thousand people, including a large part of Afghanistan’s educated elite, and many Zero-unit commandos, fled the country on last month’s U.S.-led airlift. Many more are still seeking a way to escape.

But in Afghanistan’s rural districts like Baraki Barak, where Taliban rules don’t differ that much from existing conservative customs, the calculation is different, particularly in the mostly Pashtun southern and eastern provinces. To villagers here, the collapse of the Afghan republic and the U.S. withdrawal mean, above all, that the guns have fallen silent for the first time in two decades.

Abdullah Jan Abed, the academic director of a boys' school in Baraki Barak, showing the bullet holes on the wall of his school.

Photo: Yaroslav Trofimov/The Wall Street Journal

The classroom of Baraki Barak's boys' school that was damaged by an errant rocket strike earlier this year.

Photo: Yaroslav Trofimov/The Wall Street Journal

“There was war here day and night, every day. It never ceased. The land wasn’t ours, the fields weren’t ours, the house wasn’t ours, we didn’t even have honor,” said village elder Daud Shah Khan, as he stood by the remains of the wrecked shrine. “Now, there is peace. And when someone doesn’t feel danger, doesn’t fear war, and can walk with a peace of mind, he is happy even if he is hungry,” he said.

Sixteen members of his family, Mr. Khan added, were killed during the war: three nieces, three nephews and 10 cousins. “Their graves are over there,” he said, pointing at the cemetery in the dusty field, where faded white and green flags fluttered above small gravestones.

While Kabul was hit by occasional suicide bombings and other insurgent attacks during the 20-year American presence, life in the Afghan capital remained relatively normal throughout that time, with busy streets, restaurants open late into the night and bustling markets.

A Taliban flag covers the wall of the U.S. Embassy in Kabul’s Green Zone, which was once the heart of foreign operations in Afghanistan. WSJ’s Yaroslav Trofimov visits abandoned embassies now guarded by Taliban fighters hoping foreign diplomats will return. Photo: Aamir Qureshi/AFP/Getty Images The Wall Street Journal Interactive Edition

Districts like Baraki Barak, by contrast, were the site of constant skirmishes between the Taliban, Afghan government forces and, until last year, American troops. Strategically located on the southern approaches to Kabul, Baraki Barak used to house one of the largest U.S. bases in Afghanistan, Forward Operating Base Shank, that at one time endured more frequent rocket attacks than any other U.S. outpost.

In 2012, the top American commander in Afghanistan, Marine Gen. John Allen, flew to Logar to apologize for the killing of 18 members of a wedding party in a U.S. air strike on Baraki Barak.

After FOB Shank was transferred to Afghan forces in 2014 as part of the American drawdown, the Taliban began taking over the district. By 2019, unable to defend more remote areas, Afghan government troops removed checkpoints and pulled back to the district headquarters, a walled compound of one-story buildings on Baraki Barak’s main road. Besieged by the Taliban, that compound could only be resupplied by occasional large convoys. By May, as the Taliban launched an offensive across Afghanistan, even that turned impossible.

Noor Rahman Khalili, center, was injured in an Afghan air strike last month that also wounded his son and destroyed part of his home.

Photo: Yaroslav Trofimov/The Wall Street Journal

“The siege was tightened. They tried to enter with large convoys, but couldn’t anymore,” said Mawlawi Rahmatullah Usmani, the Taliban military commander for Baraki Barak. “Eventually, we gave them an escape route and they left.” Unlike in other bases conquered by the Taliban, the Afghan troops at Baraki Barak didn’t leave any military hardware behind when they abandoned the district in late June.

Mr. Usmani was sitting at his new office in the district headquarters the night of Aug. 10 when he heard about a large convoy of Afghan Zero-unit commandos moving under the cover of darkness into villages a 15-minute drive away. At the time, insurgents were about to overrun the major cities of Ghazni, Kandahar and Herat. Scrambling his forces, Mr. Usmani thought the commandos would try to take back the Baraki Barak district headquarters.

Instead, the night raid ended with just a few arrests. The commandos retreated to Kabul before dawn. “They just wanted to show off that they are able to come to a sensitive area in a region under Taliban control,” Mr. Usmani scoffed. “But they didn’t even cause any casualties to the Taliban.”

One of the men detained in the raid was Qandagha Momand, a 35-year-old shopkeeper. Three days into his detention in Kabul, he suddenly noticed his prison guards ditching their uniforms to don traditional Afghan clothes.

“They dressed like us, left their jobs, and freed us,” Mr. Momand said. He returned to his home in Baraki Barak to find that three of the family’s cows had been killed in the raid.

“In the past, we couldn’t go outside after 5 or 6 p.m., we were afraid. We didn’t know who were our enemies and who were our friends,” he said. “Now, we have freedom. The democracy has ended.”

As in many Afghan villages, some of Mr. Momand’s neighbors have served in the Afghan army and police, while others joined the Taliban. The Taliban have proclaimed an amnesty, and some of these former soldiers have been back to their homes after Aug. 15. “We’re Muslims, humans and Afghans, our hearts are wide enough,” said Mr. Khan, the village elder. “We forgive them all.” The men, he added later, didn’t stay long and have since left for Kabul.

Mr. Usmani, the district’s military commander, said the Taliban’s focus in Baraki Barak would now turn to improving schools, providing better healthcare and rebuilding infrastructure. Schools for boys and for girls, closed earlier this year because of the coronavirus pandemic, have reopened. Shops and businesses on Baraki Barak’s central road are open, too, including several barber shops whose billboards feature photos of Justin Bieber and Gulf music stars. Women are allowed to move around without a male guardian as long as they wear the hijab, Mr. Usmani said.

The biggest of Baraki Barak’s schools is located just a few hundred yards from the district headquarters, with girls studying in the mornings in one part of the compound and boys in the afternoons in another.

Village elder Daud Shah Khan, left, speaking to residents at the site of the Aug. 10 Afghan commando raid in Baraki Barak.

Photo: Yaroslav Trofimov/The Wall Street Journal

Earlier this year, the school was frequently caught in the crossfire between the Taliban and government forces. Its roof still has a hole from a rocket, its walls pockmarked by volleys of fire and mortar shrapnel. In April, two students, aged 12 and 13, were killed and eight were injured as skirmishes erupted during classes, said Abdullah Jan Abed, the boys’ school’s academic director.

“This used to be a battlefield and we couldn’t stay here for even a second,” he said.

Five days after the fall of Kabul, classes resumed, and Mr. Abed’s school now is teeming with hundreds of boys. The curriculum has remained the same as before, he said. The only change so far has been a small white Taliban flag that stands next to a globe on his desk.

Write to Yaroslav Trofimov at yaroslav.trofimov@wsj.com