WASHINGTON — A federal judge on Wednesday halted the executions of four federal prisoners that were scheduled to begin next month, essentially stymieing the Trump administration’s plan to resume the use of the death penalty.

Judge Tanya S. Chutkan of the United States District Court for the District of Columbia issued an injunction late Wednesday that said that the executions would prevent the inmates from pursuing legal challenges to the use of lethal injection.

Attorney General William P. Barr vowed to appeal the case up to the Supreme Court if necessary. “There are people who would say these kinds of delays are not fair to the victims, so we can move forward with our first group,” he said Thursday in an interview with The Associated Press as he flew to Montana to meet with officials there.

In July, Mr. Barr announced that the government would resume executions of death row inmates after a hiatus of nearly two decades. In the intervening years, public support for capital punishment has waned, prompting 21 states to outlaw the practice.