Liberal bastions in the Big Apple and across the country are scrambling to become “sanctuary campuses” to protect illegal immigrants who they fear could be deported under a Donald Trump administration.

More than 100 colleges, including New York University and Columbia University, staged a walkout Wednesday in hopes of forcing their campuses to implement policies that they say will ensure a “safe space” for students not born in the US.

Hundreds of NYU students marched out of their classrooms at noon and took over Washington Square Park — carrying signs that said, “Not on our campus,” “NYU rising” and “We demand a #sanctuarycampus.”

“We as students are walking out today because we recognize undocumented students are among the most vulnerable on our campus and so we are rallying to say that, as citizens or students with privilege, we will put our bodies on the line between them and a Trump presidency,” said Hannah Fullerton, a junior who organized the rally.

Donald Trump has made numerous pledges to attack illegal immigration, including repealing the Deferred Action for Childhood Arrivals (DACA) program, which President Obama used an executive action to pass in 2012. It allows illegal immigrants who were in the US before they were 16 to get a renewable work permit that lets them stay in the country for two years.

The president-elect has also vowed to deport or jail up to 3 million illegal immigrants who have criminal records.

An NYU law student and DACA recipient, who would only give her name as Claudia, said Trump’s immigration policies could “devastate millions of lives.”

“My own family could be torn apart. I had have some of the most difficult conversations of my life this past week,” she said. “I’ve spoken to my mother about things like where my 8-year-old brother should go and who he should stay with. We are torn apart.”

At Ohio’s Oberlin College — one of the country’s most liberal campuses — more than 2,400 students signed a petition demanding it become a sanctuary.

“Given the outcome of the presidential election, we call on Oberlin College to stand with other colleges and universities and investigate how to make Oberlin a sanctuary campus that will protect our community members from intimidation, unfair investigation, and deportation,” the letter said.

Students pleaded with university officials to join the city of Oberlin to honor the campus’ “stated commitment to social justice, diversity, and inclusion, while extending its history of providing refuge for those seeking freedom.”

Ivy League universities including Brown, Harvard and Yale are also trying to protect their students.

“We have reason to believe Providence Police officers cannot enter the campus without permission of the University,” a Brown University faculty letter published online Monday said. “Given that many students, staff members and their families are directly affected by this issue, we urge the University to immediately work to develop a protocol for the University serving as a sanctuary campus.”