President Trump signs an executive order for border security and immigration enforcement improvements Wednesday at the Department of Homeland Security. (Pablo Martinez Monsivais/Associated Press)

President Trump on Wednesday directed his homeland security secretary to deputize local law enforcement officials to enforce immigration laws, a move that civil rights advocates fear could embolden police to racially profile those they encounter.

The directive came as part of a sweeping executive order that cracks down on people in the country without documentation and the cities that don’t readily hand them over for deportation.

The order instructs the homeland security secretary to broker agreements with governors and local officials so that state and local law enforcement authorities can enforce immigration law. It declares that those places deemed “sanctuary jurisdictions,” for blocking government communication about people’s immigration status, be disallowed from receiving federal grants. And it reinstates a program meant to deport those in the country illegally when they are arrested on other, sometimes minor, offenses.

The directives send “a shot across the bow of immigrant communities and those localities or states that are welcoming of immigrant communities,” said Cecillia Wang, deputy legal director at the American Civil Liberties Union.

“Certainly, I think the immediate purpose is to scare immigrant communities and to scare states and localities that have these so-called sanctuary policies, but I do think there’s meat to this,” Wang said. “It’s not an empty letter, and it’s not an empty threat.”

Trump had promised on the campaign trail to crack down on illegal immigration, and his early actions make good on that vow. He also signed an order Wednesday attempting to spur construction of a proposed border wall between the United States and Mexico.

The Immigration and Nationality Act already allowed the federal government to deputize local officials to enforce immigration law through what are commonly referred to as 287(g) agreements. At one time, Wang said, dozens of jurisdictions had such arrangements with the federal government, though former president Barack Obama curtailed many of them.

Immigration and Customs Enforcement still has 36 agreements in 16 states, but they are all in jails, not with local or state police agencies, an Immigration and Customs Enforcement spokeswoman said. Jessica M. Vaughan, the director of policy studies and the Center for Immigration Studies, which advocates reduced immigration levels, said in 2008 there were more than 60 agreements, including three dozen involving work outside of jails. She said the agreements were a “great program” that at one point were responsible for nearly 20 percent of Immigration and Customs Enforcement criminal deportations.

Wang said the agreements gave local police basis to essentially racially profile those they encountered. A Department of Homeland Security Inspector General investigation in 2010 found that “Claims of civil rights violations have surfaced in connection with several [law enforcement agencies] participating in the program,” and advised Immigration and Customs Enforcement to consider civil rights factors when reaching agreements. Former Maricopa County, Ariz., sheriff Joe Arpaio, who now is facing a criminal contempt of court charge for allegedly defying court orders to stop detaining suspected undocumented immigrants without a legal basis, had used the program.

Trump’s order, Wang said, would “unleash police agencies that want to get into the deportation business.”

Trump also on Wednesday ordered the return of the Secure Communities program, another controversial immigration enforcement mechanism that the Obama administration had dialed back. The program, which was administered from 2008 to 2014, checked the fingerprints of everyone taken into custody in the United States against immigration records, and immigration officials would then move for them to be detained and possibly deported.

Jeh Johnson, Obama’s homeland security secretary, had watered the program down slightly, issuing a directive instructing officials to prioritize initiating deportation proceedings against those who posed a danger to public safety. Wang said the effect of that was limited, but Trump’s undoing of it was troubling, and his order also seemed to increase the discretion of Immigration and Customs Enforcement agents, ordering them to prioritize cases against even those who had not been charged with any crimes but had “committed acts that constitute a chargeable criminal offense.”

“It’s basically just broadening again the untrammeled discretion of ICE agents to determine who they want to pursue for deportation purposes,” Wang said.

Trump also gave his homeland security secretary power to designate sanctuary jurisdictions, and he decreed that such jurisdictions should not receive federal grant money. D.C. officials warned that the nation’s capital could lose millions — or even billions — in funding over the order, though it remains to be seen if and under what circumstances federal officials will actually act on it.

There is no uniform definition of a sanctuary city. Some places refuse detainer requests from Immigration and Customs Enforcement; others provide identification cards and driver’s license to undocumented immigrants. Trump’s order seemed to define such jurisdictions only as those that violate a federal law saying officials may not restrict government entities from sending or receiving information regarding a person’s immigration status.