WASHINGTON — An American hostage who was freed in Yemen in February after nearly 18 months in captivity was rescued in an armed raid led by the United Arab Emirates with help from the United States, according to American and Yemeni officials.

The hostage, Danny Lavone Burch, had been held by a criminal Yemeni gang with a record of kidnapping Westerners for ransom. The gang was known to sell hostages to a powerful local affiliate of Al Qaeda, the officials said.

President Trump hosted Mr. Burch at the White House on Wednesday, crediting his release as a result of “great help from U.A.E. and all of our friends.” The president did not provide details, but also said Mr. Burch’s rescue was one of “a few negotiations” worldwide to free Americans held captive.

“Gosh, it’s great to be an American,” Mr. Burch told a small group of American officials and journalists in the Oval Office.