WASHINGTON — The Trump administration is considering what to do about a Qaeda suspect being held in Yemen, a decision that presents an early test of President Trump’s campaign pledge to send terrorism suspects to the military prison at Guantánamo Bay, Cuba.

The suspect, known as Abu Khaybar, was captured last fall in Yemen and is being held there by another country, according to four current and former senior administration officials. The circumstances of his detention are not clear, but he is wanted on terrorism charges in New York.

Mr. Khaybar, who is about 40, presents an important legal and policy test for Mr. Trump, who said the Obama administration was too soft on terrorists and promised to fill the prison in Cuba with “bad dudes.”

Mr. Khaybar’s suspected affiliation with Al Qaeda gives the United States clear authority to hold him in the military prison. Attorney General Jeff Sessions has repeatedly said that terrorists should not be prosecuted in civilian courts and, as recently as last month at his confirmation hearing, said the prison at Guantánamo Bay should be kept open.