Fifteen states and the District of Columbia on Wednesday sued to block U.S. President Donald Trump's plan to end a program protecting young immigrants from deportation — an act Washington state's attorney general called "a dark time for our country."

The lawsuit was filed in the Eastern District of New York. The plaintiffs were New York, Massachusetts, Washington, Connecticut, Delaware, District of Columbia, Hawaii, Illinois, Iowa, New Mexico, North Carolina, Oregon, Pennsylvania, Rhode Island, Vermont and Virginia.

The plaintiffs say Trump's decision to end protection against deportation for young immigrants was motivated by prejudice against Mexicans. Legal experts, however, say the evidence of bias is not strong in the case.

"It might be able to muck up the works, maybe push off the effective date of the repeal, but I don't see litigation being successful in the same way as the travel ban," Kari Hong, an immigration expert at Boston College Law School, said, referring to the lawsuit earlier this year that limited the Trump ban involving predominantly Muslim nations.

As indications of Trump's bias, the suit cited his previous statement referring to some Mexican immigrants as rapists and his decision to pardon former Arizona Sheriff Joe Arpaio, who was convicted of contempt for ignoring a federal court order to stop traffic patrols that targeted immigrants.

"Ending DACA, whose participants are mostly of Mexican origin, is a culmination of President's Trump's oft-stated commitments — whether personally held, stated to appease some portion of his constituency, or some combination thereof — to punish and disparage people with Mexican roots," the lawsuit filed in federal court in Brooklyn said.

Legislative solution to replace DACA

On Tuesday, Attorney General Jeff Sessions said the program, known as the Deferred Action for Childhood Arrivals (DACA), will end in six months to give Congress time to find a legislative solution for the immigrants.

The participants were brought to the U.S. illegally as children or came with families who overstayed visas.

Those already enrolled in DACA remain covered until their permits expire. If their permits expire before March, 5, 2018, they are eligible to renew them for another two years as long as they apply by Oct. 5. But the program isn't accepting new applications.

Opponents of the program said they are pleased with the Trump administration's decision. They called DACA an unconstitutional abuse of executive power, but proponents of the program said the move by Trump was cruel.

Washington Attorney General Bob Ferguson said the action violates the due process rights of the immigrants. He said he fears the information the immigrants provided the government to participate in DACA could be used against them.

"It's outrageous, it's not right," an emotional Ferguson said at a news conference in Seattle. "As attorney general for the state of Washington, I have a hammer, it's the law."

Washington Gov. Jay Inslee joined Ferguson at the news conference and said, "This is one more of a long train of abuses that this president has attempted to foist on this great nation."

Earlier this year, Ferguson sued Trump over the initial travel ban, which resulted in a federal judge blocking nationwide enforcement.

House Speaker Paul Ryan said he sees the possibility for compromise and called on Trump to work with the House of Representatives.

"If we have legislation coming through here that is worked with and supported by the president, I'm very confident that our members will support that," Ryan said.

Trump said Wednesday he has "no second thoughts" a day after announcing an end to the program former president Barack Obama created to give temporary work permits and deportation protections to qualifying immigrants who were brought to the U.S. as children.

"I'd like to see a permanent deal. And I think it's going to happen. I think we're going to have great support from both sides of Congress and I really believe that Congress is going to work very hard on the DACA agreement and come up with something," Trump said.

Compromise tied to border security

But Ryan made clear that any solution would also have to be paired with border security measures, a bid for conservative support that could alienate Democrats.

The DACA problem partly stems from borders that are "not sufficiently controlled," Ryan, a Republican from Wisconsin, told reporters after a closed-door meeting of the House Republican conference.

"I think it's totally reasonable and appropriate that when you take a look at the DACA dilemma — this is a dilemma that in large part stems from the fact that it is a symptom of a larger problem, and the larger problem is that we do not have control of our borders," Ryan said.​

Despite Ryan's talk of compromise, the deep divisions among House Republicans that have stymied past efforts on immigration reform were starkly on display.

Rep. Steve King of Iowa, a hardliner on immigration, rejected any move toward what he termed "amnesty" and criticized Trump for not ending the DACA program on Day 1 of his presidency as he had promised during the campaign.

"Why is this discussion taking place this way? Because he didn't want to make the decision boldly and distinctly," King said of Trump. "And instead it's kind of a King Solomon decision, cut the baby in half and throw both halves to Congress and let us fight over it."