SAN DIEGO — Former President Donald Trump has long pledged to deport millions of people, but he’s bringing more specifics to his current bid for the White House: invoking wartime powers, relying on like-minded governors and using the military.

Trump’s record as president shows a vast gulf between his ambitions and the legal, fiscal and political realities of mass deportations of people illegally in the United States — 11 million in January 2022, by the Homeland Security Department’s latest estimate. Former President Barack Obama carried out 432,000 deportations in 2013, the highest annual total since records were kept.

Deportations under Trump never topped 350,000. But he and his chief immigration policy architect, Stephen Miller, have offered clues in interviews and rallies of taking a different approach if they are returned to power in November.

“What Trump seems to be contemplating is potentially lawful,” said Joseph Nunn, counsel at the Brennan Center for Justice at New York University’s School of Law. “There might not be a lot of legal barriers. It is going to be logistically extraordinarily complicated and difficult. The military is not going to like doing it, and they are going to drag their feet as much as they can, but it is possible, so it should be taken seriously.”

Trump has said he would invoke the Alien Enemies Act, a 1798 law that allows the president to deport any noncitizen from a country that the U.S. is at war with.

Texas Gov. Greg Abbott has advanced a theory that illegal immigration amounts to an invasion to justify state enforcement measures, so far without success, but legal scholars say judges may be reluctant to second-guess what a president considers foreign aggression.

The sweeping Alien Enemies Act authority may sidestep a law that bans the military from civilian law enforcement.

Trump has said he would focus on deploying the National Guard, whose troops can be activated on orders of a governor. Miller says sympathetic Republican governors would send troops to nearby states that refuse to participate.

The military has been peripherally involved at the border since President George W. Bush’s administration with activities not deemed to be law enforcement, such as surveillance, vehicle maintenance and installing concertina wire.

Nunn, of New York University’s Brennan Center, said Trump may look to 2020, when he ordered the National Guard to disperse peaceful Black Lives Matter protests near the White House, despite the mayor’s opposition. Trump did so without invoking the 18th century war powers law, but the District of Columbia’s federal status gives the president outsized authority to act.

Trump also may contend with rights afforded under immigration law and court rulings that took shape after 1798, including a right to seek asylum that became law in 1980. Under a 2001 Supreme Court ruling, people illegally in the country can’t be detained indefinitely if there is no reasonable chance their countries will take them back. Cuba, Venezuela, Nicaragua and others are either slow to accept their citizens or refuse.

U.S. Immigration and Customs Enforcement is funded by Congress for 41,500 detention beds this year, raising questions about where Trump would house people before they board deportation flights and how long they could hold them if countries refuse to take them back. Miller floated the idea of “large-scale staging grounds near the border, most likely in Texas.”

While many support Trump’s plans, mass deportation could tear apart families, exacerbate labor shortages and uproot people with deep ties to their communities.

Military leaders are likely to resist because it would undercut other priorities and damage morale, Nunn said.

“The military is going see this and say this is not the kind of duty that soldiers signed up for,” he said. “This is getting the military involved in domestic politics in a way the military doesn’t like to do.”

Adam Goodman, associate professor of history and Latin American studies at the University of Illinois, Chicago, who has written about deportations, said a threat of a mass expulsion can have a serious impact even if it isn’t carried out. He thinks it highly unlikely that Trump can do what he promises, but it can strike fear in immigrant communities.

In June 2019, Trump announced ICE would “begin the process of removing the millions of illegal aliens” the following week. A month later, the agency said it targeted about 2,100 people, resulting in 35 arrests, indicating the president’s plans fell far short but only after they generated widespread concern in immigrant communities.

Trump acknowledged the political perils during an interview this week with journalist Sharyl Attkisson.

“You put one wrong person onto a bus or onto an airplane and your radical-left lunatics will try and make it sound like it’s the worst thing that’s ever happened,” Trump said, before repeating his pledge: “But we’re getting the criminals out. And we’re going to do that fast.”