President Donald Trump said on Thursday that US forces have killed Qassim al-Rimi, the leader of al-Qaeda in the Arabian Peninsula (AQAP), in an operation inside Yemen.

Al-Rimi claimed responsibility for last year's deadly shooting at US Naval Air Station Pensacola in Florida, where a Saudi aviation trainee killed three US sailors.

More:

The AQAP has long been considered al-Qaeda's most dangerous affiliate for its attempts to carry out attacks on the US mainland. Trump said the US and its allies are safer as a result of his death.

"We will continue to protect the American people by tracking down and eliminating terrorists who seek to do us harm," Trump said on Thursday.

While Trump confirmed reports that al-Rimi had been killed, he did not say when the US operation was conducted or offer any details about how it was carried out. Al-Qaeda has not confirmed his death.

Al Jazeera's Andy Gallacher, reporting from Washington, DC, said the attack that killed the 41-year-old took place last month.

"The CIA and American intelligence officials have been very careful after previous strikes proved that their targets actually survived them," he said.

"Al-Rimi is a significant target for the US authorities. He is one of the few leaders that predates the attacks of September 11," Gallacher said.

"He trained at camps in Afghanistan before going back home to Yemen where he was in prison for five years for plotting the US ambassador there. He broke out of jail in 2006 and is thought to be behind the attack on the US embassy."

In late January, a suspected US drone attack destroyed a building housing al-Qaeda fighters in eastern Yemen.

Also, on February 1, Trump retweeted several other tweets and media reports that seemed to offer confirmation that the attack had killed al-Rimi.

Shooting

Al-Rimi had said in an 18-minute video that his group was responsible for the December 6 shooting at the naval base in Florida.

He called the attacker, Saudi Air Force officer Mohammed Alshamrani, a "courageous knight" and a "hero".

The attacker opened fire inside a classroom at the base, killing three people and wounding two sheriff's deputies before one of the deputies killed him. Eight others were also hurt.

The attack focused public attention on the presence of foreign students in US military training programmes and exposed shortcomings in the screening of cadets.

In January, the US sent home 21 Saudi military students, saying the trainees had "jihadist or anti-American sentiments" on social media pages or had "contact with child pornography", including in internet chat rooms.