Taliban forces are closing in on the one part of Afghanistan they don’t control: the Panjshir Valley, near the imposing Hindu Kush mountain range north of Kabul. The Islamist group is pressing opposition leaders there to join a new government, threatening a military assault if they don’t.

Politicians in Panjshir—who say they are backed by a militia of several thousand men, bolstered by the remnants of the Afghan army, and with military hardware such as helicopters—say they have rebuffed Taliban overtures, which they say fall short of the promises of autonomy they want.

On Sunday, Taliban and rebel forces skirmished just outside the valley, a resistance leader said. Families of valley residents said the Taliban also cut telephone and internet connections to the valley.

At the same time, talks between the two sides continued, officials in both camps said.

“The problem is that they are unwilling to make any concessions. And we’re unwilling to accept any type of political system that isn’t inclusive,” said Ali Nazary, head of foreign affairs for the rebels, who call themselves the National Resistance Front.

The standoff is a test of the Taliban’s claim that, after seizing power, they seek an inclusive government that represents all the major groups in Afghanistan. Several key government officials, including Vice President Amrullah Saleh, fled to Panjshir after the Taliban seized Kabul on Aug. 15. Panjshir is home to the country’s Tajik ethnic minority.

The Taliban are offering leaders in the valley “a position in the emirate of the Taliban. That’s all they’re offering,” said Ahmad Wali Massoud, a former Afghan ambassador to London. “That will not be good for Afghanistan at all.”

Mr. Massoud is also the brother of the late Ahmad Shah Massoud, who commanded a mujahedeen guerrilla force that held out in his native Panjshir against both the Taliban regime of the 1990s and Soviet troops in the 1980s. The guerrilla leader was assassinated by al Qaeda in 2001.

Armed resistance in the valley is now being led by Ahmad Massoud, son of Ahmad Shah Massoud. Ahmad Massoud doesn’t have fighting experience but does have veteran military commanders with him.

Militiamen took part in a training exercise in Panjshir province on Sunday.

Photo: Jalaluddin Sekandar/Associated Press

The Taliban haven’t yet announced the form of the country’s new government. The Islamic Emirate that the Taliban proclaimed in 1996, and in whose name they rule now, had a strongly centralized nature. Almost all leadership positions were held by ethnic Pashtuns, Afghanistan’s biggest ethnic group.

Relatives and aides of the resistance trying to reach them from outside Panjshir Sunday said they weren’t able to connect because phone and internet links were down. The valley, which is protected on all sides by mountains, is populated by the country’s Tajik ethnic minority.

Habibi Samangani, a Taliban spokesman, said he wasn’t aware of the communications cutoff.

“The Panjshir Valley today is not only a valley, it’s the center and a safe haven and the capital for all of those that fear their lives, who are fearing Taliban terrorists and trying to get to somewhere to feel safe,” Mr. Saleh told Fox News on Friday.

Mr. Saleh, who proclaimed himself a rightful president after President Ashraf Ghani fled the country Aug.15, is operating separately from the rebels led by Mr. Massoud.

The mountains surrounding the Panjshir Valley pose a challenge for would-be invaders. A new road that enters a widened mouth of the valley, however, could make it harder to defend than in the 1980s and 1990s.

Unlike that period, Panjshir doesn’t have a supply route to an international border and its rebels lack outside support.

Russia’s ambassador in Kabul, Dmitry Zhirnov, said on Saturday that the Taliban could easily conquer Panjshir.

“The balance of military forces is such that they could take Panjshir in a day, maybe even in a few hours, but they don’t do this to avoid bloodshed,” Mr. Zhirnov said according to Russian state news agency TASS.

Mr. Nazary, of the rebels, said that while the Taliban appeared dominant, they were actually stretched thin having to secure the whole country, including cities that are much bigger than when the group ruled in the 1990s. He said that the Taliban was stronger when it came to power in 1996 than now, while Panjshir was in a weaker position back then but still managed to hold out.

“We’re confident that we can resist them,” said Mr. Nazary. “If the Taliban do make any provocative moves, then the resistance is going to spread, it’s not going to stay just in Panjshir.”

Two U.S. Republican lawmakers, Sen. Lindsey Graham of South Carolina and Rep. Mike Waltz of Florida, called Friday on the U.S. to recognize Mr. Saleh and Mr. Massoud as the legitimate government of Afghanistan.

“These leaders chose to stay and fight for the freedoms of the Afghan people and oppose extremism. They have established a safe haven in the Panjshir Valley for Americans left behind, our allies, and those seeking freedom from Afghan Taliban rule,” the lawmakers said in a joint statement.

So far, only the Afghan embassy in Tajikistan has publicly recognized Mr. Saleh’s claim.

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