In the face of President Donald Trump's threat to withhold funding from so-called "sanctuary cities"—cities including New York that limit communication between police, prisons, and federal immigration officials—Assembly Democrats on Monday passed legislation that would create similar protections for non-citizens across the state.

The legislation passed by a relatively narrow margin of 77-58, with some upstate and suburban Democrats siding with the Republicans to vote 'no,' according to Politico.

Sponsored by Queens Assemblyman Francisco Moya (D), the New York State Liberty Act would prohibit state and local police from conducting a stop or making an arrest based solely on perceived immigration status. It would also prevent government agencies from inquiring about immigration status when an individual seeks aid or reports a crime—all policies that are already established in NYC.

It would also, like NYC law, prohibit law enforcement from detaining non-citizens in precincts, jails or prisons at the request of Immigration and Customs Enforcement, under some circumstances. Exceptions would include people previously convicted of a violent or Class A felony, or those on a federal terrorism watch list. Anyone facing deportation would be guaranteed legal representation.

Another Moya bill passed as part of the package, the "One Day To Protect New Yorkers Act," has been endorsed by the New York City Bar and immigration advocacy groups including the Immigrant Defense Project. The legislation would reduce the maximum sentence for an A misdemeanor from one year to 364 days, protecting non-citizens from federal legislation that allows deportation of individuals convicted of crimes with sentences of one year or longer.

"The Assembly Majority believes that the continued success of our state depends on ensuring that immigrants have access to the resources they need to make meaningful contributions to their communities," said Assembly Speaker Carl Heastie ahead of the legislation's signing on Monday. "Without the fear of inappropriate deportation and other serious consequences."

Also on Monday, the Assembly passed the Dream Act, which would allow undocumented high school students in New York to apply for financial aid—legislation that has passed five times in the Assembly, only to be killed in the Senate. Cuomo recently endorsed the Dream Act, after dropping it last year citing a lack of Senate support.

Both bills will likely face an uphill battle in the Senate, which is currently controlled by a conservative (and, admittedly, confusing) coalition between Republicans and the eight-member Independent Democratic Conference [IDC].

Spokeswoman Candice Giove said that the IDC would vote yes on both, but Republicans lashed out at the Liberty Act on Monday, and the New York State Conservative Party issued a memo urging a 'no' vote on both bills.

"We pass laws for a reason—we pass laws to protect the public," Republican Assemblyman Dean Murray of Long Island told Politico. "Now we're asking our local law enforcement to just completely ignore some of those laws. That's a problem."

Republican Assemblyman Al Graf predicted that the bill would not pass the Senate, adding that he feared President Trump would make good on his threat to withhold funding.

"We've seen the actions of the new president and I don't think he's bluffing when it comes to taking away federal money from the states," he told NBC.

Mayor de Blasio praised the Assembly in a statement Monday, saying that the body "voted today to protect the American Dream."

In recent weeks, immigration lawyers and advocates have challenged the mayor for continuing to uphold "broken windows" policing, which has been documented to draw an outsize number of low-income people of color into the criminal justice system. According to President Trump's executive orders, non-citizens could be targeted for deportation for an arrest, even if the charge is ultimately dismissed.

Neither the established NYC immigrant protections, nor those proposed at the state level, would prohibit ICE from conducting business in New York. ICE is still "a law enforcement agency with investigative ability," Camille Mackler, director of legal Initiatives for the New York Immigrant Coalition, told Gothamist earlier this month.

The Governor's Office did not immediately comment on the legislation. Nor did Senate Majority Leader John Flanagan.