The leader of al Qaeda in the Arabian Peninsula (AQAP) was the main target of a U.S. raid in Yemen last week, military and intelligence officials tell NBC News, but he survived and has recorded a message heckling President Trump.

The intent of the mission to either capture or kill Qassim al-Rimi was kept a close secret, the officials said, and it's unclear if al-Rimi was tipped off ahead of the raid, was never at the compound, or escaped during an exchange of gunfire. Al-Rimi, who took over AQAP in 2015, is considered the third most dangerous terrorist in the world, and several military officials told NBC News he is still in Yemen. They say the recording that surfaced after the raid is authentic, and features al-Rimi mocking Trump, saying, "The fool of the White House got slapped at the beginning of his road in your lands."

The officials say the mission was deemed worth the risk because of the prospect of killing or capturing al-Rimi, and Trump was told by Defense Secretary James Mattis and the chairman of the Joint Chiefs of Staff "they doubted that the Obama administration would have been bold enough to try it," NBC News reported, paraphrasing "a senior White House official with direct knowledge of the discussions." The raid involved SEAL Team 6 and dozens of other Americans, Yemeni soldiers, and commandos from the United Arab Emirates. A senior U.S. intelligence official told NBC News "almost everything went wrong" once the raid started, with the occupants of the home being targeted almost immediately alerted that the operation was taking place. Chief Petty Officer William "Ryan" Owens of SEAL Team 6 was killed in the raid; so were 14 al Qaeda members and civilians, including the 8-year-old daughter of the U.S.-born radical cleric Anwar al-Awlaki, who himself had been killed in a 2011 airstrike in Yemen.

After the raid, the White House declared it a "successful operation by all standards," and the Pentagon said in a statement that U.S. forces found "materials and information that is yielding valuable intelligence." Catherine Garcia