US president Donald Trump could have saved himself some embarrassment this week if he had consulted his local library rather than Fox News before mentioning terror attacks in Sweden. For across the country, librarians have stepped in to verify facts and authenticate web content in a bid to counter fake news reports.

Not that he would have felt welcome, because the profession has placed itself in the vanguard of resistance to his policies on refugees and immigration, according to Elizabeth Flock of PBS Newshour. The intervention follows the president’s executive orders banning immigrants from seven predominantly Muslim countries and threatening to pull federal funding from cities that defy the ban.

The move reflects the key role libraries play in the lives of new Americans, with more than half visiting the institutions at least once a week, according to the Institute of Museum and Library Services, a point made by the American Library Association (ALA) at the end of last month when it condemned the immigration ban.

“Our nation’s 120,000 public, academic, school and special libraries serve all community members, including people of colour, immigrants, people with disabilities and the most vulnerable in our communities, offering services and educational resources that transform communities, open minds, and promote inclusion and diversity,” it said in a statement that encouraged its 57,000 members to speak out against the administration.

School librarians were first off the mark against the new president and his followers, countering so-called “fake news” though information tools that promote researcher-vetted content on websites and by hosting community discussions and talks about critical thinking. Reports that the new administration had limited the flow of information from some departments was also condemned as censorship by the ALA’s Office for Intellectual Freedom.

But librarians have stepped up their activities since the executive orders were issued last month. In Nebraska, assistant library director Rebecca McCorkindale created a poster using the tagline “Libraries for Everyone” that has been used to support campaigns across the US. Hennepin County library in Minnesota, which serves large Somali and Spanish communities, offered one typical response: it joined the “All are welcome here” campaign in a bid to reassure locals. Bernie Farrell, youth programs and services coordinator, said: “We want them to feel welcome. We want them to feel safe. We want them to feel that if they ask questions about any topics, we’ll give them relevant and helpful information or relevant and helpful referrals.” Librarians in Cambridge, Massachusetts followed others by declaring their libraries sanctuary spaces in which illegal immigrants can seek protection, advice and help without fear or judgment.

In Oregon, a library in Multnomah County, has promoted children’s books about refugees and immigrants, while others libraries have sold badges with the All Are Welcome slogan. In Pennsylvania, a Yemeni-American, Muslim doll has been made available at checkouts. Massachusetts-based librarian Elizabeth McKinstry told PBS Newshour: “We are huge resources for newcomers to this country, whether it’s for connection to this country, legal resources, testing preparation, citizen tests, services like story times or homework help. We are there for the most vulnerable folks in our communities, people on the other side of the digital or language divide.”

Co-ordinating much of the campaign has been Matthew Haugen, a librarian at Columbia University, who set up the LibrariesResist Twitter account. The account and accompanying hashtag highlights local campaigns, shares resources and explains how libraries can be used as sanctuary spaces. Among materials available, according to the Public Books website, are a Stop Trump reading list and a Trump syllabus – a course that “explores Donald Trump’s rise as a product of the American lineage of racism, sexism, nativism and imperialism”.