(CNN) A Canadian man was sentenced to life in prison for stabbing a police officer in the neck at the Flint, Michigan, airport in 2017 while yelling "Allahu Akbar," the US attorney for the Eastern District of Michigan announced Thursday.

Amor Ftouhi, now 51, was charged with an act of terrorism transcending national boundaries and two other crimes, violence at an international airport and interference with airport security.

"Amor Ftouhi tried to kill Lt. Jeff Neville on June 21, 2017," US Attorney Matthew Schneider wrote in a sentencing memorandum filed last week.

Almost two years ago, Ftouhi arrived at Flint's Bishop International Airport carrying two bags, and lingered for about 40 minutes in the airport's public areas, including a restaurant and a bathroom where he dropped his bags, prosecutors said before his indictment 21 months ago.

Ftouhi approached Neville, who was in full uniform, and stabbed him twice in the neck with a knife, according to the US attorney.

Authorities said Ftouhi yelled "Allahu akbar" -- a common Arabic phrase meaning "God is great" -- and used a roughly 12-inch knife with an 8-inch serrated blade to stab Neville. The US Attorney's Office said Ftouhi also referenced killings in Syria, Iraq and Afghanistan while stabbing the officer.

Neville survived the attack, despite life-threatening injuries.

Prosecutors say Ftouhi planned the attack for months

"Ftouhi began planning for his attack no later than March 21, 2017, when he used his Google account to find the location of Novi, Michigan," Schneider said in his sentencing memo, adding that Ftouhi chose Michigan because he believed it would be the easiest place to buy a gun.

Court records detail Ftouhi's internet searches that show he researched locations of gun shows and gun stores in Michigan as well as government surveillance techniques.

Ftouhi arrived in the United States on June 16, 2017, and, made several attempts to buy a gun, according to the US Attorney's Office. After unsuccessful attempts to purchase a gun, he bought a knife instead.

When his planning began, Ftouhi was living in Montreal. He emigrated to Canada in 2007. Ftouhi was raised in Tunisia, where he was a schoolteacher. He was married and had a child born in the late 1990s, according to court records.

Before leaving Canada, Ftouhi left "what he described as his last will and testament," court records show.

"Ftouhi asked his wife to tell his family that he 'did not go out, save for God and for the victory of His religion and His rules, hoping that God grant me the eternal heaven and paradise.' He explained to her that, although she had been a good wife and he loved her, his 'love for God Almighty and the Jihad for His sake is greater,'" according to the sentencing memo.

Ftouhi admitted to a radical ideology

Ftouhi told law enforcement officials after his arrest that he was "a solider of Allah," believed in the ideology of al Qaeda and Osama bin Laden and had planned to kill the victim, steal his gun and kill other police officers in the airport, according to a Thursday news release.

"Ftouhi said that he has and always will have a strong hatred for the US government. He explained that he was angry about US support for Israel and US actions in conflict areas in the Middle East," Schneider wrote in the sentencing memo. "All of this evidence clearly shows that Ftouhi's terrorist attack was an act of vengeance and in retaliation for US government conduct."

Ftouhi was arraigned in federal court in 2017, and his attorney asked the court to enter pleas of "stand mute."

According to "A Dictionary of American and English Law, With Definitions of the Technical Terms of the Canon and Civil Laws," "a prisoner is said to stand mute when, being arraigned for treason or felony, he either makes no answer at all, or answers foreign to the purpose, or with such matter as is not allowable, and will not answer otherwise."

The judge entered a plea of not guilty. Ftouhi was convicted by a federal jury in 2018.

"Ftouhi came to the United States to kill American police officers, and then brutally attacked an airport police officer in Flint," said Assistant Attorney General John Demers. "The National Security Division is committed to doing all that it can to protect our women and men in uniform from terrorist violence on our soil, and this sentence is a gratifying reflection of the seriousness of the defendant's conduct. I want to thank the prosecutors and law enforcement partners who made this result possible."

CNN has reached out to Ftouhi's attorneys for comment but has not heard back.