A 4th Circuit Court of Appeals judge on Friday questioned a Justice Department attorney about whether President Trump had the authority to "ban all men" from entering the United States.

Judge Barbaro Milano Keenan, appointed by former President Barack Obama, quizzed Justice Department Deputy Attorney General Hashim Mooppan about whether he thought Trump could keep all foreign men from entering the United States. The judge asked the question during the federal appeals court's review of Trump's newest policy that bans people from several countries that are home to terrorist activities.

"Let's just say that this study contains information, which is likely to be true, that most terrorists or people who commit terrorist acts are men," Keenan said. "Could the president then ban all men under the express authority of [federal law]? Could he ban the entry of all men until the president showed further that men are not the ordinary and customary perpetrators of terrorist activity?"

"I don't think so, your honor," Mooppan said.

"Why not?" Keenan asked.

"Because I don't think that using gender as a proxy would satisfy Mandel's requirement of facially legitimate —" Moopan said before Keenan interrupted him.

"OK, if you can't use gender, then there's the question of violating section 1152," Keenan said.

The full federal appeals court's review of Trump's third ban focused, in part, over the conflict between two federal statutes: 8 U.S. Code § 1182 that defines which foreign nationals are inadmissible and another, 8 U.S. Code § 1152, that prevents discrimination in the visa issuance process.

Trump's third effort aimed at implementing the travel ban focused on blocking foreign nationals from several countries that are home to terrorist activities that are also Muslim-majority countries.

Keenan's question seemed aimed at drawing out the point made by opponents of the ban who say the policy change is driven by Trump's desire to ban Muslims, but the Trump administration has said it's needed because of the risk those countries pose given the presence of terrorist elements.

The newest version of the travel ban added Chad, North Korea, and Venezuela to the list of countries affected by the travel ban.

Friday's arguments at the 4th Circuit Court of Appeals arrived after a federal judge in Maryland blocked Trump's ban, but excluded North Korea and Venezuela from the judge's ruling. The Supreme Court on Monday lifted the Maryland judge's stoppage of Trump's ban.