OSLO – Former Norwegian prime minister Kjell Magne Bondevik has said he was held at a US airport earlier this week because he had visited Iran in 2014, while immigration officials told him it was unrelated to President Trump’s temporary ban on Iranian nationals.

Although Bondevik, who is Norway’s longest serving non-Labour Party prime minister since World War II, flew into Dulles Airport from Europe Tuesday afternoon and says he was not immediately allowed to leave after customs agents saw in his diplomatic passport that he had been to Iran in 2014. He was held for about an hour for questioning.

He showed ABC7 that his passport also indicates he is the former prime minister of Norway, a U.S. ally.

Instead, he was told it related to a 2015 law which places extra restrictions on countries that are part of the US visa waiver programme signed by Obama, according to an interview with ABC7 news.

The law was signed in the wake of terrorist attacks in California and Paris and was aimed at protecting the U.S. from terrorists.

It places extra restrictions on some citizens from 38 countries — including Norway — that are part of the U.S.’s Visa Waiver Program.

Citizens of those countries normally do not need a visa to visit the U.S. for up to 90 days, but because of the law they now do need a visa if they have been to Iran, Iraq, Sudan, Syria, Libya, Somalia or Yemen since March 2011. These are the same seven countries Trump included in his temporary travel ban.

But Mr Bondevik said he has never had an issue travelling to the US with the same document before Donald Trump’s order.

Bondevik says his office contacted the U.S. Embassy in Oslo prior to his trip this week and was told his passport and a separate electronic travel authorization (called ESTA) would be sufficient to enter the United States.

“I was surprised, and I was provoked,” he said about being set aside for questioning. “What will the reputation of the U.S. be if this happens not only to me, but also to other international leaders?”

“Of course I fully understand the fear of letting terrorists come into this country,” Bondevik told ABC7 outside the Washington Hilton. But, he said, it should have been obvious he’s not a terrorist.

Instead, Bondevik says he was placed in a room with travelers from the Middle East and Africa who were also facing extra scrutiny. He says he had to sit and wait for about 40 minutes, and then he was questioned for about 20 minutes regarding a trip to Iran three years ago.

“There is no reason to be afraid of a former head of government who has been on official visits several times to this country, including in the White House,” he told Norwegian broadcaster TV2.

Bondevik is president of a human rights organization called The Oslo Center, and in 2014 he went to Iran to speak against extremism at a human rights conference there, the BBC reported.

The former prime minister, from 1997-2000 and 2001-2005, was flying to the US to attend the national prayer breakfast event in Washington – which President Donald Trump also attended.