A ruling by the U.S. Supreme Court on Thursday that partially rebuffed President Donald Trump’s administration for a citizenship question on the U.S. Census was hailed by Attorney General Letitia James.

New York, immigration advocacy groups and other states had sued the Department of Commerce over the question. The court in a 5-4 decision upheld a lower court’s decision over the question being barred from the Census.

Gov. Andrew Cuomo also praised the ruling.

“This decision will help ensure each and every New Yorker will be counted and provided with the critical services they need and deserve, regardless of their immigration status,” Cuomo said. “Shame on the Trump Administration for its attempt to make the U.S. Census a political pawn in their continued anti-immigrant agenda.”

But the court also returned a split verdict over different aspects of the case.

New York officials, as well as immigrant rights groups, were worried the citizenship question would lead to an under counting of people fearful of deportation. That, in turn, could lead to New York losing representation in Congress.

“This one question could have caused a substantial undercount, particularly of noncitizens and Latinos,” James said.

“Thanks to the Court, the census will remain a tool for delivering on our government’s promise of fairness and equity, and states, like New York, will not be shortchanged out of critical resources or political representation. Our democracy withstood this challenge, but make no mistake, many threats continue to lie ahead from the Trump Administration and we will not stop fighting. Now, more than ever, the marginalized, the disenfranchised, and everyday people need us to stand firm in our fight for justice. After all, everyone counts, and therefore, everyone must be counted.”

The New York Immigration Coalition, which was a plaintiff in the case, called the decision “a victory for immigrants, communities of color, and our democracy.”

“We have always known that the Trump administration’s inclusion of the question was designed to deny immigrant rich states access to our fair share of federal funding and political power,” said Executive Director Steven Choi. “But the fight is not over, which is why we’ll continue to fight this administration’s attacks on our immigrant communities in the courts, in the legislature, and in the streets.”