President Trump said Thursday that the U.S. has conducted a counter-terrorism operation in Yemen that killed Qassim al-Rimi, an al-Qaeda leader who claimed responsibility for last year's deadly shooting at the Naval Air Station Pensacola. During that shooting, a Saudi aviation trainee killed three American sailors.

Al-Rimi is a founder of al-Qaeda in the Arabian Peninsula. The affiliate has long been considered the global network's most dangerous branch, for its attempts to carry out attacks on the U.S. mainland. Mr. Trump said the U.S. 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," Mr. Trump said.

Get Breaking News Delivered to Your Inbox

While Mr. Trump confirmed reports that al-Rimi had been killed, he did not say when the U.S. operation was conducted or offer any details about how it was carried out.

Al-Rimi had said in an 18-minute video that his group was responsible for the December 6 shooting at the base. He called the shooter, Saudi Air Force officer Mohammed Alshamrani, a "courageous knight" and a "hero." The shooter 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 shooting focused public attention on the presence of foreign students in American military training programs and exposed shortcomings in the screening of cadets. In January, the U.S. 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.

Mr. Trump's announcement confirmed earlier indications that al-Rimi had been killed. In late January, a suspected U.S. drone strike destroyed a building housing al-Qaeda militants in eastern Yemen. Also, on February 1, Mr. Trump retweeted several other tweets and media reports that seemed to offer confirmation that the strike had killed al-Rimi.