President Trump proposed a dramatic expansion of the law at the center of the administration’s fight against sanctuary cities — changes that could enable the federal government to punish cities like San Francisco for shielding immigrants.

Tucked deep in Trump’s budget plan, which was released Tuesday and faced immediate scrutiny from legislators, is a proposed rewriting of U.S. Code 1373, which says cities cannot block employees from communicating with federal officials about individuals’ immigration status.

Under the proposal, which prompted outrage from San Francisco officials, the government could condition Homeland Security and Department of Justice grants on guarantees that cities comply with the expanded scope of the law.

That would include a mandate that local jail officials hold releasable inmates for up to 48 hours under requests from immigration agents known as detainers, or at the very least “provide reasonable notification prior to the release.”

Many sheriff’s departments, including San Francisco’s, refuse to honor such detainers, which are a top priority for U.S. Immigration and Customs Enforcement.

In addition, the proposal states that grant recipients may be required to send the federal government information on the “nationality, citizenship, immigration status, removability, scheduled release date and time, home address, work address, or contact information” of all inmates and suspects.

San Francisco and many other cities maintain they comply with the current law. But an expansion of the statute — which would have to be passed by Congress — could change the landscape.

The move came nearly a month after U.S. District Judge William Orrick of San Francisco blocked the Trump administration from enforcing an executive order seeking to cut funding to cities and counties with sanctuary policies.

Tuesday’s proposal, immigration law experts said, could be a response to the ruling, which said the president was exceeding his constitutional authority and that such funding conditions could only be imposed by Congress.

“Once again, this administration has demonstrated why they can’t be trusted,” said San Francisco City Attorney Dennis Herrera. “They are trying to sneak major changes in the law through the back door because they cannot get them through the front. These proposed changes would fly in the face of the Constitution.”

The proposal, contained in a 1,284-page appendix of Trump’s budget plan, came a day after Attorney General Jeff Sessions signaled publicly that the administration was narrowing its effort to gain cooperation from sanctuary cities.

Sessions said in a memo on the implementation of Trump’s executive order that it would only seek to withhold federal grants from the Department of Justice and the Department of Homeland Security from jurisdictions that “willfully refuse to comply” with U.S. Code 1373.

Orrick said late Tuesday he would grant the Trump administration’s request to reconsider his April ruling in light of the Sessions memo. He gave San Francisco and its co-plaintiff, Santa Clara County, two weeks to file opposing arguments.

Sessions said in the memo that the government may “tailor” future grants to “promote a lawful system of immigration.” But he did not mention the proposal to rewrite the law.

Lee Lofthus, an assistant attorney general, told reporters Tuesday that the provision “basically makes some changes to some of the rules regarding cooperation with immigration officials.”

The Justice Department had previously said in court that there are three grant programs that may be jeopardized over the sanctuary issue, but it has not taken any steps to cut federal aid. Herrera has said San Francisco receives about $1.5 million a year in those grants.

The debate over immigration detainers has raged for many years. Federal agents say the detainers allow them to efficiently target people who are both dangerous and deportable.

But advocates for immigrants say jail officials who are asked to honor immigration holds should not do so because of the possibility of detaining U.S. citizens, increased costs, and legal liability related to incarcerating people beyond their release dates.

California’s Trust Act limits the situations in which jails can hold individuals wanted by immigration agents. In San Francisco, a criminal warrant is required.

“What we are seeing on every front here is the administration continuing efforts to harness local law enforcement in the business of immigration enforcement,” said Christopher Lasch, a professor and immigration expert at the University of Denver’s Sturm College of Law.

While the administration hopes to expand the use of detainers, current law “doesn’t get the administration where it wanted to go,” he said. “That’s what this is aimed at ... putting the thumb on the scale and basically forcing jurisdictions to come back into the fold.”

Hamed Aleaziz is a San Francisco Chronicle staff writer. Email: haleaziz@sfchronicle.com Twitter: @haleaziz