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 Pakistan's neighbour 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.
Kristiansen had already attracted controversy for saying her agency could not have done more to prevent the attacks by Islamophobe Anders Behring Breivik, who committed the worst attacks in the Nordic country since World War Two.
"Not even Stasi-Germany would have managed to isolate and catch this person," she told state broadcaster NRK three days after Breivik's double attack.
"You would almost have had to have a chip inside the head of every single Norwegian, to capture all thoughts."