JALALABAD/Islamabad - Islamic State jihadists Wednesday claimed responsibility for a deadly gun and bomb siege targeting the Pakistani consulate in Afghanistan's Jalalabad city, in the first attack by the group on the Pakistani government.

Afghan officials said all three attackers and seven security forces were killed in the brazen assault in eastern Nangarhar province, where the group has made alarming inroads in recent months.

The four-hour siege near the consulate comes amid renewed international efforts to revive peace talks with the Taliban, locked in a tussle for supremacy with Islamic State jihadists in Afghanistan.

In an Arabic statement released via Twitter, the IS group said two of its fighters blew themselves up at the scene by detonating explosive belts, while a third managed to escape unharmed.

"The attack lasted almost four hours during which the consulate building was destroyed and tens of its employees were killed together with a number of officers from the apostate Pakistani intelligence services," the statement said.

The toll appeared to be exaggerated, with Islamabad saying officials at the consulate itself are safe and accounted for.

The brazen assault sent terrified young students in an adjacent school fleeing the area, which is also close to the Indian diplomatic mission.

"This is first attack claimed by IS against the state of Pakistan," Muhammad Amir Rana, a Pakistani security analyst, told AFP. "This is a highly symbolic attack as the Pakistani consulate is a high-profile installation in Jalalabad."

There was no immediate comment on the IS group's claim from Islamabad.

In a statement earlier Wednesday, Pakistan's foreign office "strongly condemned" the attack on its consulate.

"The government of Afghanistan has been requested to thoroughly investigate this incident and bring the culprits to book," the Pakistani government said in a statement.

"We have requested that details of the investigation should be shared with us."

Islamabad has officially denied that the Islamic State organisation is operating in Pakistan, but authorities have expressed fears the jihadists could find recruits among the country's myriad of militant groups.

In May last year, the IS group claimed responsibility for an attack that claimed the lives of at least 43 members of the Ismaili minority in Karachi.

Afghan President Ashraf Ghani phoned Pakistani Prime Minister Nawaz Sharif Wednesday to assure him of greater security for Islamabad's diplomats in Afghanistan following the attack, according to a statement from the prime minister's office in Islamabad.

Afghan President apprised Pakistani PM of the attack on the consulate in Jalalabad and expressed his concern and grief over the incident.

Nawaz Sharif thanked the Afghan President for his concern and also conveyed his condolences on the deaths of Afghan security personnel.

The PM said: “Terrorism is a common enemy of both the countries and we will fight this menace together to eliminate it once for all.”

Soon after the attack Foreign Office in Islamabad strongly condemned the terrorist attack on the Consulate General of Pakistan in Jalalabad.

“The Government of Afghanistan has been requested to thoroughly investigate this incident and bring the culprits to book. We have requested that details of the investigation should be shared with us,” Foreign Office spokesman said.

“The officials of the Consulate General are safe. Only one official was slightly injured by a broken glass,” the spokesman added.

The Government of Afghanistan has also been requested to ensure safety and security of Pakistan Missions in Afghanistan and our officials working there.

The Jalalabad attack bore chilling similarities to a similar deadly siege last week near the Indian consulate in Mazar-i-Sharif. No group has claimed that attack so far.

Nangarhar faces an emerging threat from loyalists of the Islamic State group, which controls territory across Syria and Iraq and is making gradual inroads in Afghanistan, challenging the Taliban on their own turf.

The jihadists have managed to attract disaffected Taliban fighters increasingly lured by the group's signature brutality that has made them notorious.

In a sign of their growing reach in Afghanistan, the group has taken to the airwaves in a 90-minute Pashto-language radio show called "Voice of the Caliphate".

The government has said it is trying to block the broadcast, beamed from an undisclosed location, that is aimed at winning new recruits.

This week representatives of Afghanistan, Pakistan, the United States and China met in a bid to revive stalled Taliban peace talks, even as the insurgents wage a brazen winter campaign of violence.

The so-called "roadmap" talks were meant to lay the groundwork for direct dialogue between the Afghan government and the Islamists to end the 14-year Taliban insurgency.

The four-country group is set to hold the next round of discussions on January 18 in Kabul.