OSLO  - Norway's internal security chief resigned late on Wednesday after revealing confidential information that the country had intelligence agents in Pakistan, government officials said.

Janne Kristiansen, already under fire for missing signs that a far-right extremist was preparing attacks that killed 77 people in July, said the small Nordic nation had operatives in Pakistan during a parliamentary hearing earlier on Wednesday.

Kristiansen, the head of the agency in charge of Norway's internal security (PST), did not say why the agents were there.

But Norway, a close ally of the United States, has hundreds of troops in the Nato-led operation in Afghanistan. "PST head Janne Kristiansen has informed the justice minister that she will resign her position," the justice ministry said in a statement. "The reason is the possible breach of confidentiality through the disclosure of classified information."

According to a transcript of the parliamentary hearing, Kristiansen made the comments in reply to questions on whether Norway should have contacts with Pakistani intelligence. She said the intelligence agency operated by the Norwegian armed forces, the E service, already worked in Pakistan.

"The E service has its representatives in these countries, so we cooperate via the E service about this country," she said.

The Norwegian daily VG said on its website that this exchange about Pakistan was the reason why the security chief resigned. A government source told Reuters the VG news report was correct.

According to BBC, Norway's head of intelligence Janne Kristiansen has handed in her resignation because she said too much during a parliamentary hearing. Justice Minister Grete Faremo told reporters that a "potential breach of confidentiality is a very serious matter".

Reports say Pakistan has asked Norway to explain her remarks. A justice ministry spokesman told BBC that the Norwegian Police Security Service (PST) chief had "drawn her own conclusions".

Norway has 400 troops in Afghanistan as part of the Nato-led force and Ms Kristiansen was apparently asked at the parliamentary hearing about the PST's links with neighbouring Pakistan. Norwegian media say army intelligence has never confirmed operating agents in Pakistan.

 Unconfirmed reports also say the Pakistan authorities have summoned Norway's ambassador in Islamabad to explain Kristiansen's remarks.

Her role as head of the PST will be taken by her deputy, Roger Berg.