Mayors across the country are defying Donald Trump's executive order attacking sanctuary cities.

New York City mayor Bill De Blasio blasted the president in a news conference Wednesday, bashing the order signed by Trump to cut federal funding for cities that do not arrest or detain undocumented immigrants.

De Blasio vowed not to 'deport law-abiding New Yorkers', 'tear families apart', or 'leave children without their parents'. He also said that Trump's order would contradict itself by decreasing the NYPD's resources, thus making it harder for the city to fight terrorism and crime.

Mayors in Santa Fe, Chicago, San Francisco, Seattle and Boston have all defied the president's order and pledged to protect immigrants.

New York City Mayor Bill De Blasio bashed Donald Trump's executive order attacking sanctuary cities Wednesday (pictured) and defied the president

Boston mayor Marty Walsh said Trump's order was an attack on 'Boston's people, Boston's strength and Boston's values'.

'If people want to live here, they'll live here. They can use my office. They can use any office in this building,' he said according to USA Today.

His Chicago counterpart, Rahm Emanuel, said: 'I want to be clear. We're gonna stay a sanctuary city. There is no stranger among us.

'We welcome people, whether you're from Poland or Pakistan, whether you're from Ireland or India or Israel and whether you're from Mexico or Moldova, where my grandfather came from, you are welcome in Chicago as you pursue the American Dream.'

In Seattle, Mayor Ed Murray said he had told city officials to brace themselves for a potential cut in funding.

'This city will not be bullied by this administration. We believe we have the rule of law and the courts on our side,' he said.

Meanwhile in San Francisco, Mayor Ed Lee told reporters: 'I am here today to say we are still a sanctuary city.

'We stand by our sanctuary city because we want everybody to feel safe and utilize the services they deserve, including education and health care.'

Boston mayor Marty Walsh (pictured) said Trump's order was an attack on 'Boston's people, Boston's strength and Boston's values'

In Seattle, Mayor Ed Murray (pictured) said he had told city officials to brace themselves for a potential cut in funding as it defied Trump's executive order

Meanwhile in San Francisco, Mayor Ed Lee (pictured) told reporters: 'We stand by our sanctuary city because we want everybody to feel safe and utilize the services they deserve'

De Blasio led the charge in New York City Wednesday, telling reporters the executive order would keep police from properly doing their job.

'(There are) hundreds of American cities where this executive order could undermine public safety, create a rift and a disconnect between police and those they serve, and take away federal funding from law enforcement,' De Blasio said Wednesday according to CBS New York.

He pledged to protect the identity of New York City and its history.

'This is a city of immigrants. We always have been for almost 400 years. This is our fundamental nature,' he said.

'We're a city in which people, regardless of their documentation status, know that they can report a crime, or if they're a victim of a crime they can come forward, if they're a witness to a crime they can come forward, and know that that information will be used to keep all of them safe and will not be used to deport them.'

Trump's executive order, De Blasio said, has been written in a 'very vague fashion' and could be legally challenged.

Trump signed an executive order Wednesday (pictured) to cut federal funding for cities that do not arrest or detain undocumented immigrants

De Blasio continued to bash the order on Twitter after his news conference, saying Trump's decisions did not affect New York City's values

Defiance: The mayor vowed not to 'deport law-abiding New Yorkers', 'tear families apart', or 'leave children without their parents'

He also said Trump's executive order would decrease the NYPD's resources to fight terrorism and crime - and pledged on Twitter not to let this happen

Trump's executive order, De Blasio said, has been written in a 'very vague fashion' and could be legally challenged. He said on Twitter he was prepared for a legal fight

The mayor continued his charge against the president on Twitter Wednesday, writing: 'The president's executive order runs contrary to our values, but the stroke of a pen does not change the people of New York City.'

He added in further messages: 'We are not going to deport law-abiding New Yorkers.

'We will not tear families apart. We will not leave children without their parents.

'We are not going to undermine the progress the NYPD has made over a quarter century.

'We believe we are on solid ground for a legal challenge to the executive order should the occasion arise.'

De Blasio then retweeted a message from his wife, Chirlane McCray, showing two photos of immigrant families arriving to New York City with the caption: 'THIS is our history. THIS is New York. THIS is America. We will not turn our backs on our neighbors.'

Demonstrators in Los Angeles also held a vigil at City Hall as they responded to Trump's executive orders on immigration in Los Angeles

Protesters also held signs near the White House during a protest about Trump's immigration policies after he signed his two executive orders Wednesday

Demonstrators outside the White House stayed until after the sun set and blocked traffic during rush hour in Washington, DC

One man held a sign reading 'We are all immigrants' as he stood among a crowd of protesters gathered outside the White House Wednesday

Meanwhile another demonstrator held a sign that read 'I [heart] my Muslim neighbors' as she protested following Trump's two anti-immigration orders

Demonstrators also rallied outside of City Hall in San Francisco Wednesday, voicing their disagreement with Trump's anti-immigration orders

Meanwhile, hundreds of demonstrators rallied in New York City's Washington Square Park Wednesday (pictured) to protest against Trump's anti-immigration measures

Demonstrators echoed De Blasio's pledge on Wednesday by gathering in Washington Square Park to voice their support of immigration in New York City

New Yorkers rallied for the second day in a row against President Trump Wednesday. Pictured, one brought a sign reading 'I pledge to protect #immigrantny' Wednesday

Protesters held signs reading 'I love #immigrantny' as they voiced their disagreement with Trump's executive order attacking sanctuary cities

One demonstrator brought a handmade sign reading 'Trump lies' to the Washington Square Park protest Wednesday, which saw hundreds of New Yorkers rally

He also posted an excerpt from his news conference, during which he said: 'This is a picture of the immigrant experience, right here before you. It's also a picture of a city that works and a city that respects all people, tries to include everyone and respect their rights.

'This is the American dream, right before your eyes and we are not going to allow it to be undermined.'

Meanwhile, hundreds of demonstrators rallied in New York City's Washington Square Park Wednesday to protest against Trump's anti-immigration measures.

New Yorkers had demonstrated the previous day against his decision to unblock construction of the Dakota Access and Keystone XL oil pipelines.

This time, their signs read: 'I pledge to protect #immigrantny' 'New Yorkers for immigrant justice' and 'Trump lies'.

One of Wednesday's demonstrators in Washington Square Park brought a sign reading: 'No hate, no fear, refugees are welcome here'

Another protester carried a sign reading 'Stop Islamophobia now' as hundreds voiced their disagreement in New York City's Washington Square Park

One of the demonstrators carried a sign reading 'Justice' beneath the Washington Square Arch. It was the second day in a row that New Yorkers rallied against Trump

While De Blasio pledged to protect the city's undocumented immigrants despite Trump's executive order, demonstrators made similar promises on their signs

Hundreds gathered in Washington Square Park Wednesday to protest against Trump's stance on immigration and to speak out for immigrant rights

One demonstrator held a sign reading 'United 4 justice' at Wednesday's protest that saw hundreds gather in Washington Square Park

Accusation: A protester marching in Washington Square Park held up a sign with Trump's portrait and the word 'traitor' written on it

Demonstrators chanted slogans in New York City during Wednesday night's demonstration against Trump's order cracking down on immigration

Protesters lit candles in Washington Square Park after the sun set while the massive protest carried on in New York City

Meanwhile demonstrators in Philadelphia, Pennsylvania, protested outside the location of the Republican congressional retreat Wednesday night

Protesters held a 'Queer Rage' dance party outside the location of the three-day congressional retreat Wednesday night in Philadelphia

One protester held a rainbow flag while another held a sign reading: 'Stop normalizing hate' Wednesday night outside the Republican retreat

Republican lawmakers were faced with protesters when they gathered Wednesday for the first of three days of retreat, during which they intend to map out their agenda

A crowd settled outside of Philadelphia's Lowes hotel Wednesday nights as GOP figures began their annual congressional retreat

One demonstrator came with a sign featuring a photo of Martin Luther King Jr and the quote: 'Let no man pull you low enough to hate him'

Protesters yelled outside the hotel where Republican lawmakers gathered Wednesday night to establish their agenda for the coming months

One man could be seen yelling as he held a sign reading 'Resist' among the crowd of protesters Wednesday night in Philadelphia

Police officers stood by as a crowd of demonstrators spoke out against the GOP and Trump outside of the congressional retreat

The crowd of demonstrators filled the street outside the Loews Philadelphia Hotel, where Republican lawmakers had gathered