A person holds an American flag as they participate in a ceremony to become an American citizen during a U.S. Citizenship & Immigration Services naturalization ceremony at the Miami Field Office on August 17, 2018 in Miami, Florida.

LOS ANGELES — A federal judge on Wednesday blocked the administration of President Donald Trump from adding a citizenship question on the 2020 U.S. census, ruling that it is unconstitutional and unlawful. It marks the second federal judge this year to rule against the administration on the issue.

California argued that Commerce Department Secretary Wilbur Ross' plan to add the question would discourage immigrants and Latinos from participating in the census. They also contended it would cause an undercount and jeopardize congressional seats and billions of dollars in federal funding.

The ruling by U.S. District Judge Richard Seeborg in San Francisco found that the citizenship question violates the Constitution's Enumeration Clause, which requires "actual enumeration" of all people in each state every 10 years. It also was found to be in violation of the Administrative Procedure Act's prohibition against agency action that is "arbitrary and capricious."

At least six lawsuits have been filed over the Trump administration's plans, including several in New York. A federal judge in Manhattan in January also blocked the Commerce Department's plans to add the citizenship question.

The U.S. Supreme Court also has weighed in on the controversy, announcing last month it will hear arguments on the administration's plans. The action came after U.S. Solicitor General Noel Francisco asked the high court to intervene and skip over the appeals court, contending the federal judge in Manhattan, Jesse Furman, overstepped his authority and quicker action was necessary to prepare the census questionnaires.

Furman and Seeborg are both Obama appointees.

California's separate case in San Francisco included a trial that started in January. Legal experts say Seeborg could have waited for the Supreme Court to act but may have decided to act because California with its large immigrant population has perhaps the most to lose in a census undercount.

"The record in this case has clearly established that including the citizenship question on the 2020 Census is fundamentally counterproductive to the goal of obtaining accurate citizenship data about the public," Seeborg wrote. "This question is, however, quite effective at depressing self-response rates among immigrants and noncitizens, and poses a significant risk of distorting the apportionment of congressional representation among the states."

The Commerce Department announced last March it would reinstate the citizenship question on the upcoming census to help enforce the 1965 Voting Rights Act. California led a coalition of more than a dozen attorneys general that had cautioned Commerce prior to the announcement that a citizenship question would be unconstitutional and a violation of federal statutes.

"Justice has prevailed for each and every Californian who should raise their hands to be counted in the 2020 Census without being discouraged by a citizenship question," California Attorney General Xavier Becerra said in a statement Wednesday. "We celebrate this ruling, an important step in protecting billions of dollars meant for critical services Californians rely on, from education, to public health and safety."

The last time the citizenship question was asked on the census was in 1950.

According to Seeborg, the Department of Justice initially "opted not to request" the citizenship question be added despite a request from Commerce.

"Only after Secretary Ross personally interceded with then Attorney General Jeff Sessions did the DOJ switch its position," the California judge wrote.

"Despite unrefuted evidence produced by the professional staff of the Census Bureau that inclusion of a citizenship question would likely result in a significant differential decline in self-response rates within noncitizen and Latino communities and that the requested data could be obtained by other means, Secretary Ross insisted upon adding the citizenship question to the census," Seeborg said in the ruling. "When Census Bureau staff offered to meet with DOJ staff to ascertain if other available data could be used to meet their VRA enforcement needs, DOJ took the unprecedented step of refusing to allow even such an inter-agency meeting to take place."

In his ruling Wednesday, Seeborg said the decision by Commerce "was arbitrary and capricious, represented an abuse of discretion, and was otherwise not in accordance with law."

The Justice and Commerce departments did not immediately respond to requests for comment.