New Jersey Gov. Phil Murphy announced Monday that the Garden State would set aside more than $2 million to provide legal aid for low-income immigrants facing deportation.

The first-year Democrat announced the allocation in the current fiscal year's budget hours before a federal judge barred the Trump administration from enforcing a recently enacted rule denying asylum to anyone who crossed the U.S.-Mexico border illegally.

"Families who came to New Jersey for a better life do not deserve to be torn apart by the federal government's cruel and discriminatory policies," Murphy said in a statement.

The budget agreement calls for $925,000 to go to Legal Services of New Jersey and the American Friends Service Committee. Legal Services is a nonprofit that helps low-income residents. The Friends committee is a Quaker, immigrants-rights organization. Rutgers and Seton Hall's law schools will also each get $125,000.

New Jersey joins other Democrat-controlled states like New York and California that offer legal help to poorer immigrants. Last year, a public-private partnership to help immigrants was announced in New York, whose immigrants are detained at Immigration and Customs Enforcement (ICE) facilities in New Jersey's Bergen and Hudson counties.

New Jersey Republicans criticized the expenditure on Monday.

State Sen. Kristen Corrado said she's concerned about Murphy constraining Legal Services' ability to help residents, including seniors and veterans, by requiring the organization spend on immigration aid.

"When Legal Services already turns away many people who are desperate for help due to resource limitations, we shouldn't limit how new funding can be used," she said.

Assemblyman John DiMaio was more critical, saying that state funds should not be used toward immigrants in the country illegally when school funding is a constant concern.

"The spending choices of this administration are indefensible and irresponsible," DiMaio said in an emailed statement.

The Friends Service Committee estimated that the annual cost of legal representation for immigrants in the state's detention centers is about $15 million. In addition to the Bergen and Hudson county jails, ICE holds immigrations at a jail in Essex County and maintains a facility in Elizabeth.

ICE doesn't release information on how many immigrants are detained in New Jersey.

Chia-Chia Wang, the director of organizing and advocacy at the American Friends Service Committee estimates that there are roughly 1,200 people detained in New Jersey. The Pew Research Center estimates that New Jersey has about 500,000 immigrants who are in the country illegally.

The Associated Press contributed to this report.