President Trump will swing for the fences in his last immigration legal battle at the Supreme Court, where he claims authority for the first time in the nation’s history to exclude undocumented residents when deciding the size of each state’s congressional delegation.

Opponents of his plan say it is foreclosed by more than 200 years of practice, the text of the Constitution and the authority granted the president by Congress. Three lower courts have ruled against Trump, and a fourth said the time was not ripe for a decision on the question’s merits.

But the president’s lawyers will tell the Supreme Court on Monday that it is up to the president to decide whether undocumented immigrants should be counted, a decision that could have far-reaching implications for a state’s representation in Congress and power in the electoral college, and for billions of dollars in federal funds.

“The president need not treat all illegal aliens as ‘inhabitants’ of the states and thereby allow their defiance of federal law to distort the allocation of the people’s representatives,” acting solicitor general Jeffrey B. Wall wrote in the government’s brief to the court.

“To the contrary, that an alien lacks permission to be in this country, and may be subject to removal, is relevant to whether he has sufficient ties to a state to rank among its ‘inhabitants.’ ”

Trump’s approach could shift congressional seats from states with large immigrant populations, such as California, and spare some rural and Republican areas, such as Alabama, expected to lose a member of Congress.

Trump’s immigration policy initiatives have tested the Supreme Court before. In 2018, the court ruled 5 to 4 that the president had authority to bar some immigrants from mostly Muslim countries. Last year, by the same count, it said his administration had not followed proper procedures in trying to add a citizenship question to the census form.

Trump’s opponents say his reapportionment intentions, announced in a July memorandum, are an extension of that. Legally, they say, his plan is directly contradicted by the Constitution’s requirement to base apportionment of the House of Representatives on “the whole number of persons in each state” as determined by the once-a-decade census.

The constitutional mandates mean undocumented immigrants are included in that “whole number,” argues New York, one of the states challenging Trump’s intentions.

The inclusion was “the result of a clear choice to provide representation in the House to all persons affected and served by the federal government, and not only to citizens or voters,” New York Attorney General Letitia James says in the state’s brief. “The presidential memorandum at issue here defies these unambiguous mandates and breaks with more than two hundred years of history.”

Trump’s memorandum indicated he believed that some states would be getting more congressional seats than deserved — California was implied but not named — because of their numbers of undocumented residents.

He directed Commerce Secretary Wilbur Ross to provide him with two sets of numbers, one that includes unauthorized immigrants and one that does not, “to the maximum extent feasible and consistent with the discretion delegated to the executive branch.” It remains unclear how Ross may attempt to do this, without a citizenship question on the census form and with no conclusive tallies in existence indicating how many undocumented people live in each state.

Commerce Secretary Wilbur Ross listens as President Trump speaks in the White House Cabinet Room.

Dale Ho, a lawyer at the American Civil Liberties Union who is among those who will argue at the court Monday, said the president is trying to “weaponize” the census and that his power to direct the count does not stretch so far.

“It’s right that the president has broad discretion, but it has never been held that the president has discretion to subtract people from the total numbers,” Ho said.

The special three-member court decision under review by the Supreme Court said Trump’s memorandum was “an unlawful exercise of the authority granted” to him by Congress and that the question was “not particularly close or complicated.”

But the decision also gives the Supreme Court a way out if justices don’t want to make such an important decision before the end of the year.

It said the states and organizations challenging the president’s memorandum had legal standing only because it might “chill” participation in the census by immigrant groups.

Now that the census has been completed, the government argues, the rationale no longer applies. It says the Supreme Court should simply vacate the opinions of the lower courts and wait to see if the Census Bureau can even come up with the numbers the president has requested, and whether they make any difference in reapportionment.

But Thomas Wolf, senior counsel at the Brennan Center for Justice at New York University’s School of Law, said that if the Supreme Court delays a decision, “a bad actor is liberated to test the limits of our apportionment system that has never been disrespected or abused in the manner that the president is proposing.”

There are big questions about whether and how the president can realistically exclude undocumented immigrants from state population totals, even if the justices were to agree he has the authority.

The government has not explained how it plans to identify and count undocumented immigrants. An estimated 10.5 million to 12 million live in the United States, but the law requires that apportionment numbers be based on an actual enumeration of people living in a state, not estimates, and no comprehensive list of undocumented immigrants exists.

Attempts to count them could involve subtracting citizens and legally documented noncitizens — such as refugees, people with student or work visas, and green-card holders — from the total population count. But that could miss others who are authorized to be in the United States, such as people protected by the Deferred Action for Childhood Arrivals program, or those who have applied for asylum.

Government officials have suggested they will use lists of people in Immigration and Customs Enforcement detention on April 1, Census Day. But that is a fraction of the total, and would likely not be enough people to change the apportionment of House seats.

Another barrier is time: Delays caused by the coronavirus pandemic put the census several months behind schedule. The government initially requested that Congress approve a four-month delay to the Dec. 31 statutory deadline to deliver state population counts for apportionment. But after Trump issued his memo, the bureau changed course and said it would deliver the numbers by that date after all, compressing the six months it had planned for post-count data analysis to around 2 1/2 months.

In mid-November, however, bureau staffers told Commerce Department officials the state population counts would not be ready until late January or February, after Trump is scheduled to leave office, according to people familiar with the discussions who, like others, spoke on the condition of anonymity due to the matter’s ongoing sensitivity. It is unclear how much additional time it would take to give the president a second set of numbers reflecting a count of undocumented immigrants.

The Census Bureau has not confirmed that the estimated delivery date had changed. Its director, Steven Dillingham, issued a statement saying “certain processing anomalies” had been discovered during post-count analysis.

Some of the anomalies are “critical defects” that will require time to investigate, said Terri Ann Lowenthal, a former staff director of the House Oversight census subcommittee.

“The counts for group facilities appear to be way off in some cases,” she said. “For example, there may have been a prison that showed up as being counted but with a zero population, or the count of a group quarters was larger than the estimated population for an entire county.”

Critics of the president’s memo say they worry career staff workers at the bureau are under pressure from Trump political appointees to produce state population counts and a tally of undocumented immigrants while he is still in office, regardless of their accuracy.

Census employees are working overtime and on weekends, in some cases up to 15 hours a day, and have been pulled off other tasks to try to produce the numbers by early January, according to a person familiar with the situation who described the workers as exhausted and frustrated.

House Oversight Committee Chairwoman Carolyn B. Maloney (D-N.Y.) last week blasted the bureau for repeatedly canceling or refusing meetings about the status of the census. The committee has scheduled a hearing on the census for Thursday.

Steven Dillingham, director of the Census Bureau, testifies during a House Oversight Committee hearing in February.

It is up to the president after receiving state population counts to informCongress within one week of the opening of its next session how its 435 seats are to be allocated. The House clerk then has 15 days to inform the states of the number of representatives to which each is entitled.

It is unclear what would happen if competing sets of numbers are in play during that process.

“Nobody knows, we haven’t thought about this,” said Justin Levitt, a constitutional law professor at Loyola Law School in Los Angeles. “There haven’t ever been fights about ‘Are you just giving us numbers that we are not going to accept?’ ”

Historically, other attempts to exclude people from being counted for apportionment have failed, said Wolf, with the Brennan Center. “From the framing to Reconstruction to 230 years of congressional practice, they all show that the answer to this is very simple: All people count.”

Levitt agreed, saying, “The only things that are really thorny questions are questions about whether this is the right time or whether plaintiffs have to wait until the president actually takes action. . . . It will be interesting to see whether the government tells the court that they’re not going to get this done in time for this administration.”

If Trump gives data to Congress that seems flawed, his successor, President-elect Joe Biden, could ask the Census Bureau to review its numbers or deliver a revised tally.

Lowenthal, the former staff director of the House Oversight census subcommittee, said competing data sets would likely spark lawsuits.

“If President Trump transmits a set of numbers to the House of Representatives that later runs of the data show was not the most accurate result, clearly we would have states that either thought they would have gained one or more seats or that they shouldn’t have lost one or more seats going to court,” Lowenthal said, adding, “Even when there’s only one set of apportionment numbers, there are lawsuits.”