WASHINGTON — The NAACP is spearheading a lawsuit filed Wednesday against the Census Bureau and President Donald Trump, saying the federal government is unprepared for the 2020 Census, and that will lead to a massive undercounting of African-Americans.

The group wants a federal judge to oversee the Census Bureau’s plan to avoid an undercount for minority communities.

The lawsuit filed in U.S. District Court in Maryland contends that understaffing, inadequate funding and the use of on-line forms will exacerbate historic undercounts for communities of color.

“As we continued to look at past undercounts and the Census Bureau’s preparations for 2020, we came to the conclusion we were witnessing a train wreck in the making,” said Bradford Berry, general counsel for the NAACP.

The decennial census is required by the Constitution and used to determine the number of seats each state has in the House, as well as how federal money is distributed to local communities.

Berry said his organization has been working with the Yale Law School Rule of Law Clinic on concerns about the 2020 Census. They used the Freedom of Information Act to obtain records from the Commerce Department about its preparations.

Prince George’s County, Maryland, joined in the lawsuit. Its elected leaders said the county stands to lose critical federal funds and voting power if the 2020 Census takes place without major changes. Blacks make up a majority of the county’s population.

The 2010 Census undercounted 2.1 percent of the black population nationally and 1.5 percent of the Hispanic population, according to a Census Bureau estimate.

The lawsuit has been months in the making and is separate from efforts being taken in states, including California, New York and New Jersey, to prevent a citizenship question from being included in the decennial census. The Census Bureau did not immediately respond to a request for comment on the NAACP’s lawsuit.

Lawmakers on Capitol Hill have also expressed concerns in recent months about the Census Bureau’s preparation for the 2020 count, and recently passed legislation to increase spending at the agency by $1.3 billion this fiscal year. That’s double what the Trump administration had requested, and GOP lawmakers said the bump would allow for adequate preparation for the decennial census.