The Bay State cities of Chelsea and Lawrence — both homes to large immigrant populations — filed suit this morning against President Donald J. Trump, contending his executive order vowing to pull federal funding from "sanctuary cities" is unconstitutional.

"The Executive Order seeks, without congressional authorization, to commandeer local officials to enforce the federal government's immigration policies, and threatens municipalities with crippling losses of funding, apparently including funding for programs with no connection to law enforcement, if the municipalities do not come to heel," states the 45-page complaint filed in U.S. District Court. "Particularly for smaller and more impoverished cities and towns, the impact of this Executive Order is both immediate and chilling."

Lawrence has a Trust Act ordinance, meaning police do not detain anyone who may be of interest to federal immigration officials unless there is a criminal warrant outstanding for their arrest. Chelsea, the suit says, "self-identifies" as a sanctuary city for undocumented immigrants.

The complaint argues Chelsea and Lawrence "rely on federal funding to fill critical budgetary needs and … cannot afford uncertainty over whether they will lose federal funds or be subjected to undefined 'appropriate enforcement action' by the Attorney General if they are found to have policies or practices that 'hinder' federal law enforcement."

Lawrence Mayor Daniel Rivera said Lawrence receives approximately $36 million in federal funding that helps pay for everything from elementary school lunches to workforce development, deleading, the municipal airport and law enforcement.

"Shame on (Trump) for bringing this type of light onto communities like ours," Rivera said of Trump. "We do our part with criminals, giving them no safe haven. But we will not do the federal government's job."

Chelsea City Manager Thomas G. Ambrosino said his city receives approximately $10 million in federal funding, mostly in school grants.

Slamming Trump's sanctuary jurisdiction order as "pure lunacy," Ambrosino said his city's police department has worked hard to build a relationship with illegal immigrants, and he doesn't want residents to be reluctant to report crime for fear the feds will deport them.

"The policies that we have in place in Chelsea have a singular goal: to make our citizens safer," Ambrosino said. "It's essential that our police department in no way, shape or form have anything to do with federal immigration. This is a public safety issue for the city of Chelsea."

"We have built a community of trust," agreed Gladys Vega, executive director of the Chelsea Collaborative. "We don't care how you enter the country, we care that you're a protected member of our society. This doesn't enhance anything in our community. This is so wrong, so inhumane."

In his Jan. 25 executive order, Trump charged that "sanctuary jurisdictions across the United States willfully violate Federal law in an attempt to shield aliens from removal from the United States. These jurisdictions have caused immeasurable harm to the American people and to the very fabric of our Republic," and vows to "ensure that jurisdictions that fail to comply with applicable Federal law do not receive Federal funds, except as mandated by law."

More than 400 U.S. jurisdictions — which collectively receive billions in federal funds — have some sort of policy regarding how they deal with people in the country illegally. In general, sanctuary cities declare that local authorities cannot keep immigrants in custody to be handed over to federal immigration officials if they have no violent felonies on their records and do not face criminal charges.

Attorney Inez Friedman-Boyce, co-chair of the Lawyers' Committee for Civil Rights and Economic Justice, said Chelsea and Lawrence may not stand alone for along.

"We have been in contact with other communities in Massachusetts, some of which have reached out to us," she said. "It is possible, but no formal decisions have been made, that others may join the litigation."

Today's suit accuses Trump and Homeland Security and Department of Justice officials of violating the principles of federalism and separation of powers, and asks that a federal judge declare Trump's order unconstitutional, and establish that the two cities are already in full compliance with federal immigration law.

“The federal government continues its efforts to trample the rights of minorities and immigrants and to pursue its agenda of thinly cloaked discrimination," said Ivan Espinoza-Madrigal, executive director of the Lawyers' Committee, which made today's filing. "It is our responsibility to stand up and protect the rights that define us as a society and are enshrined in our Constitution. It is not enough for this Administration to detain and interrogate refugees and immigrants at airports – now it seeks to punish, through executive action, communities that are lawfully protecting their residents. We are taking this civil rights struggle from the street to the courtroom to compel the federal government to comply with the rule of law."

The case has been assigned to U.S. District Court Judge George A. O'Toole Jr. and summonses have been issued to the defendants.

The sanctuary city order is also currently the subject of a suit by the city of San Francisco, and a pitched legal battle is expected. Some federal courts have found that local jurisdictions cannot hold immigrants beyond their jail term or deny them bond based only a request from immigration authorities. And San Francisco's suit notes that in a 2012 ruling on Obamacare, the court decided 7 to 2 that the federal government could not threaten states with loss of money for failing to comply with a Medicaid requirement.

The latest suits comes as other suits are pending over the Trump administration's separate executive order restricting travel from some Muslim-majority countries.

Herald wire services contributed.