Los Angeles, the second largest US city, is setting itself up for a standoff with President-elect Donald Trump over immigration.

On Tuesday, its city council passed a “sanctuary city” ordinance to bar using local resources to help federal immigration authorities.

LA’s public school system also reaffirmed itself as a “sanctuary” for undocumented immigrants and LGBTQ students in a series of emergency resolutions.

Trump, who will be sworn in in two months, has promised mass deportations once he returns to the White House. His chosen “border czar”, Tim Homan, has urged sanctuary cities to “get the hell out of the way” of federal immigration crackdowns.

The term “sanctuary city” has been popular in the US for more than a decade to describe places that limit their assistance to federal immigration authorities. Since it is not a legal term, cities have taken a variety of approaches to becoming “sanctuaries”, such as setting policies in laws or simply changing local policing practices.

Aimed at making a 2019 executive order into city law, the city council’s sanctuary city ordinance prohibits using city resources for immigration enforcement, including cooperating with federal immigration agents, NBC News Los Angeles reports.

The ordinance will “prevent federal immigration enforcement from being able to access city facilities or to use city resources in the pursuit of immigration enforcement”, council member Nithya Raman told CBS News, the BBC’s US partner, ahead of the vote.

It will also prohibit some data sharing between immigration authorities and city officials and agencies.

The ordinance will go into effect once it has been signed by Mayor Karen Bass.

Officials in a number of other cities, including Boston and New York City, have similarly promised that local resources would not be allocated to helping federal immigration enforcement issues.

Since Trump was elected the first time, dozens of school districts have declared themselves “sanctuaries” or “safe havens” to reassure students they will not be deported.

The Los Angeles school district – roughly 140 miles (225km) from the country’s southern border with Mexico – also voted on a series of emergency resolutions explicitly aimed at combatting what the board’s president, Jackie Goldberg, has described as an anti-immigrant and LGBTQ sentiment from the incoming president.

As well as restating a sanctuary policy for students and families within the school district, the resolution also calls for training for teachers and staff about how they should communicate with immigration authorities.

“We’re not going to be running in fear,” she said in quotes cited by the LA Times ahead of the resolution’s passing. “We’re going to fight you, every inch of the way.”

The move is likely to put the city on a collision course with the incoming Trump administration, which has vowed it will begin a large-scale mass deportation effort from the very beginning of the administration.

Trump’s chosen “border czar”, former acting Immigrations and Customs Enforcement director Tom Homan, has repeatedly said that “sanctuary” city designations would not prevent the administration from carrying out its immigration policy goals.

In an 11 November interview with Fox, Homan said “nothing will stop us from deporting migrant criminals.”

“We’re going to do the job with you, or without you,” he said.