At least seven Afghan security personnel have been killed in a gun battle near the Pakistani consulate in Jalalabad, the interior ministry says.
The gunmen barricaded themselves in a house after a suicide attack on the consulate compound in the city.
Witnesses reported heavy gunfire and explosions. Reports say all the gunmen were killed.
It was not immediately clear who carried out the attack, which follows a bomb near the Indian mission last week.
The Pakistani consulate is in the same area as the Indian diplomatic mission in Jalalabad, capital of Nangarhar province.
Three insurgents were killed last week in an attack on the Indian consulate in the northern Afghan city of Mazar-e-Sharif.
Nangarhar police chief Fazil Ahmad Shirzad said three attackers had been killed.
"Three suicide bombers carrying guns were involved in this attack and were killed by Afghan forces," he told Reuters.
Interior ministry spokesman Sediq Sediqqi said in a tweet: "Seven of our security forces were killed and seven others wounded as a result of the terrorist attack."
Residents and children from a nearby school were evacuated.
At least one of the suicide bombers is reported to have joined a queue of people applying for visas. He blew himself up after being stopped from entering the building.
Three civilians were among the wounded, the police chief said.
Observers have speculated that the attacks, as well as a deadly four-day militant raid on an Indian air force base, could be linked to fledgling peace moves between India and Pakistan, but there is no confirmation.