The bill aims to prohibit the detention of undocumented immigrants in New York without a standing warrant from a judge.
"If you are living in New York, you are a New Yorker, your immigration status is of no consequence,” said Assemblyman Francisco Moya, a Democrat from New York's Queens neighborhood in New York City.
"Sanctuary city" is a broad term used to describe municipalities that have enacted policies that keep local law enforcement from aiding in federal deportation policy.
New York's statewide measure passed the Democratic-controlled assembly just one day after Trump threatened to cut federal funding to the state of California over their similar effort.
During his first week in office, Trump signed an executive order directing the Departments of Justice and Homeland Security to withhold federal funding "except as mandated by law" from sanctuary cities. Officials in those cities are puzzled by the language of the order and skeptical of its constitutionality.
The New York bill now advances to the state Senate, which is controlled by a coalition of Republicans and right-leaning Democrats. The Republican state Senate leader said on Tuesday that he didn't expect the body to even vote on the bill.
However, should it manage to make its way out of the Senate and onto Governor Andrew Cuomo's desk, New York can almost certainly expect a harsh tweet or two from the president of the United States.