A former New Zealand student who built a bomb used in an Isis suicide attack was allegedly inspired by a close friend's death.

Taie bin Salem bin Yaslam al-Saya'ari was gunned down by police in Saudi Arabia on Sunday.

Authorities say he planned an attack last year at one of Islam's holiest sites, manufacturing a bomb used in the July 4 suicide attack outside a mosque where the Prophet Muhammad is buried which killed four Saudi security force members.

After shooting Al-Saya'ari over the weekend police found two explosive belts, two machine guns, a home-made grenade and basins filled with chemicals.

Advertisement

The Saudi man is believed to have lived and studied in New Zealand between 2008 and 2013.

His former friend Homoud Alsalem told Fairfax Al-Saya'ari left in 2013 to join ISIS and fight Bashar Assad's regime in Syria, after about a year of expressing increasingly radical beliefs.

"One year before he left he changed - became more isolated, more religious, more enthusiastic about the Syrian revolution.

"He would watch the news all the time about it. He became enthusiastic, sympathetic with the jihadists."

"Another student studying in New Zealand went to Syria and got killed as part of the Islamic State. I think that shocked him, and made him sympathise with the jihadists more."

Alsalem said he met Al-Saya'ari through mutual friends and knew him for several years.

"He was by far the smartest Saudi student I knew in New Zealand," Alsalem told Fairfax.

"I would see him in the library teaching other Saudis - he was a leader in his field.

"He was a moderate and charming guy. He was smart enough to know that this was quite wrong."

Alsalem said if a student as smart as Al-Saya'ari could be radicalised it could happen to anyone.

"He's not just any guy. If this could happen to him it could happen to any Saudi."