The Taliban claimed Monday to have overcome the last pocket of resistance in Afghanistan, releasing images they said showed the conquest of the provincial capital of Panjshir, a region that has held out against the group’s takeover of the country.

The Taliban, who took control of most of the country this summer, culminating with the capital city of Kabul on Aug. 15, made the declaration as they prepare to announce a new government.

On Monday, pro-Taliban social-media accounts posted a video of what they said were their fighters—whom they call mujahedeen or holy warriors—raising the group’s white flag over the governor’s house in the provincial capital of Panjshir. Other pictures and videos showing their presence there were also published.

“Thank God that with the sacrifices and hardships of the mujahedeen this last province was also conquered,” said one unidentified Taliban fighter, standing in front of the governor’s house. “Praise be to God, now all 34 provinces of Afghanistan are completely in the hands of the mujahedeen.”

The rebels denied the Taliban’s claim, saying their militia was present in all the strategic positions in the valley and was continuing to fight.

Panjshir, home to the country’s Tajik minority, had remained the only province of Afghanistan not under the Taliban when they had marched into Kabul. The group hadn’t managed to take the province when they last ruled, in the 1990s, nor had the Soviet Union when it invaded in the 1980s.

A resistance group, claiming to be thousands strong, had refused to accept the Taliban takeover. It has been led by Ahmad Massoud, son of famous Afghan military commander Ahmad Shah Massoud. Also holed up in Panjshir was the former vice president of the fallen government, Amrullah Saleh, who had proclaimed himself the rightful president after Afghan President Ashraf Ghani fled the country after the Taliban entered Kabul.

Forces resisting the Taliban in the Panjshir region are being led by Ahmad Massoud, seen in July.

Photo: ahmad sahel arman/Agence France-Presse/Getty Images

The rebels initially held talks with the Taliban, seeking devolution of power to the provinces and inclusion of all ethnic groups in the new government. Those talks didn’t make progress, with the Taliban continuing their military push into Panjshir instead in recent days.

On Monday, in an audio recording released by the resistance, Mr. Massoud said that they had offered a cease-fire and restarting the talks on Sunday but the Taliban had launched an attack instead, which killed many, including some of his family. Mr. Massoud didn’t address Taliban claims of entering the provincial capital in the recording, or say where he was. He called for armed resistance, as well as political protests, across Afghanistan.

Mr. Massoud said that the Taliban would bring “an Afghanistan that is kept backward, ridden with obscurantism, bereft of civilization and art, devoid of unity and solidarity, and a country that is forced into economic and political isolation.”

Ali Nazary, head of foreign affairs for the resistance group, said that Mr. Massoud was still inside Afghanistan.

Small, peaceful protests by women, unconnected to the armed resistance in Panjshir, have taken place in several cities in recent days. They have been demanding basic freedoms and rights, but they have been met at times with violence by the Taliban.

On Monday, women came out in the northern city of Mazar-e-Sharif. They chanted, “Education, work and security are our absolute rights” and “Victory without women is meaningless.” Their placards included messages such as “Women are not erasable” and “A city of only one sex stinks.”

A group of male journalists, trying to cover the event, were forced away by an armed Taliban fighter.

One of the women, a 28-year-old, told The Wall Street Journal tearfully after the protest by phone that Taliban fighters had made insulting remarks to them as they marched, including lurid sexual jibes. Eventually they were surrounded by armed Taliban who had come in pickup trucks. A senior local Taliban figure told them to end the protest and said he relayed their demands to the authorities.

“Everyone in the protest was very scared,” she said. “Many times, the Taliban threatened us and said they would run their pickup trucks over us.”

The Taliban spokesman, Zabiullah Mujahid, told a news conference on Monday that arrangements would be made that would allow women to go to work, but he didn’t say when.

‘We tried our best to solve Panjshir’s problems through negotiations, but it didn’t work,’ Taliban spokesman Zabiullah Mujahid said Monday.

Photo: epa/Shutterstock

He said that there wouldn’t be reprisals against the people of Panjshir, saying they had the same rights as other Afghans. However, he warned that any other forces that raise resistance would be considered an enemy.

“We tried our best to solve Panjshir’s problems through negotiations, but it didn’t work,” said Mr. Mujahid. “We had to conduct our operations because a separate island can’t exist in the country, and Afghan people have the right for threats to them to be cleared.”

Mr. Mujahid also said a government would be formed soon but didn’t give a date. He said foreign countries would be invited to attend the inauguration of the Taliban administration.

“We assure you that we will build a strong, accountable, Islamic and responsible system,” said Mr. Mujahid.

The U.S., Europe and some of Afghanistan’s neighbors have called for the incoming Taliban administration to include members of factions from across the country. Washington has said the treatment of women will also be a key marker to judge the new government.

Forces resisting the Taliban trained in the Panjshir region last week.

Photo: ahmad sahel arman/Agence France-Presse/Getty Images

Mr. Mujahid also denied rumors that the group’s leader, Mullah Haibatullah Akhunzada, is dead. The group’s emir, or spiritual leader, hasn’t been seen or heard from since the Taliban’s entry to Kabul.

He said the Taliban were working to fully restart civilian flights out of Kabul airport, and criticized the U.S. for damaging equipment during the withdrawal of American troops. Turkey and Qatar, along with the U.S., have also said they are providing help to reopen the airport, which would enable remaining foreign citizens and Afghans at risk to leave the country more easily.

The U.S. facilitated the evacuation of four American citizens from Afghanistan on Monday via an undisclosed overland route, a State Department official said, in what is believed to be the first such confirmed exit since the U.S. finished evacuating troops and civilians last month via the Kabul airport.

The Taliban were aware and didn’t impede the departure of the American citizens, who were in good condition and received by State Department personnel in an undisclosed country bordering Afghanistan, the official said.

Secretary of State Antony Blinken arrived in Doha, Qatar, on Monday, part of a trip to thank partner countries for their help during the military withdrawal, review evacuation efforts and develop an office in Qatar that serves the function of an Afghanistan embassy.

Write to Saeed Shah at saeed.shah@wsj.com