WASHINGTON—The Trump administration said Monday it would withhold federal criminal-justice grants from cities, counties and states that don’t fully cooperate with federal immigration authorities, a first strike in the new administration’s battle against so-called sanctuary cities.

Attorney General Jeff Sessions said Monday that he was reaffirming a more limited Obama-era policy that threatened to pull grants from jurisdictions that bar officials from communicating with federal agencies about immigration, and implied that more sweeping rules were coming. He also said the Justice Department would try to take back previously granted funding from places that don’t comply with the communications law.

“When cities and states refuse to help enforce immigration laws, our nation is less safe,” Mr. Sessions said at the White House. “I strongly urge our nation’s states and cities and counties to consider carefully the harm they are doing to their citizens by refusing to enforce our immigration laws and to rethink these policies.”

People on both sides of the debate saw the announcement as an early step in an expected crackdown on cities that refuse to cooperate with federal immigration enforcement. It is also possible that Trump officials will enforce the rule more aggressively than their predecessors did.

The rules don’t address the question at the heart of sanctuary cities: whether jurisdictions can be forced to hold undocumented inmates in jail longer than planned when federal immigration officers issue “detainers” requesting time to pick up the inmates so they can be put into deportation proceedings. President Donald Trump threatened to withhold federal grant funding from places that don’t cooperate.