A day after President Trump threatened to send the suspect in the Manhattan truck attack to the military prison at Guantánamo Bay, Cuba, Attorney General Jeff Sessions on Thursday said the administration would “use all lawful tools at our disposal,” including the federal courts and military system, to prosecute terrorism suspects.

He also touted the Justice Department’s recent terrorism prosecutions, remarks that may not have been notable if Mr. Trump had not, a day earlier, denounced the American criminal justice system as “a joke” and “a laughingstock.”

Mr. Sessions’s remarks on Guantánamo Bay reiterated a long-held position in favor of continuing to detain terrorism suspects without trial there and to prosecute some before a military commission. He said earlier this year that he would advise Mr. Trump to send newly captured terrorism suspects to the wartime prison, which he called a “very fine place,” rather than to bring them to civilian court for prosecution by the Justice Department he runs.

But his comments took on new urgency when Mr. Trump on Wednesday said he was open to transferring the Manhattan truck attack suspect, Sayfullo Saipov, 29, from civilian courts into the military system set up for foreign terrorists. A short time later, just more than 24 hours after the attack, federal prosecutors filed charges accusing Mr. Saipov of being inspired by Islamic State propaganda videos to carry out the plot and of timing it to inflict maximum damage.