Immigration hard-liners’ anger toward Oakland Mayor Libby Schaaf for her warning about a federal sweep for undocumented migrants in Northern California led an Iowa congressman to propose criminal penalties Monday for officials who talk about such operations in advance.

Republican Rep. Steve King introduced the “Mayor Libby Schaaf Act of 2018,” which would ban officials from “the purposeful broadcast ... of information relating to any imminent action by a federal law enforcement officer or agent.” Violations could result in up to five years in prison.

King said his bill would make clear that disclosing an imminent enforcement would amount to obstruction of justice.

“I want lawless, sanctuary city politicians to hear this message clearly: If you obstruct ICE, you are going to end up in the cooler,” King said in a statement.

In February, Schaaf said she had learned “credible sources” that U.S. Immigration and Customs Enforcement agents were planning a sweep for undocumented immigrants in the Bay Area. She said her goal in disclosing the operation was to give immigrant families information about their legal rights and resources.

Now Playing:

The subsequent four-day sweep across Northern California resulted in 232 arrests. ICE chief Thomas Homan initially suggested that 800 undocumented immigrants were able to evade detention because of Schaaf’s alert, leading to the resignation of the department’s San Francisco spokesman, who said that information was incorrect and misleading.

President Trump said as recently as last week that U.S. Attorney General Jeff Sessions should consider opening an obstruction case aimed at Schaaf. The White House previously said the Justice Department is conducting a review into her actions.

A spokesman for the mayor’s office, Justin Berton, said Monday it has yet to receive any requests for documents or interviews from federal investigators. Former U.S. Attorney Melinda Haag is among the lawyers who are advising the mayor on legal issues.

Schaaf, who is running for re-election this fall, said in an interview on CNN that “it’s not possible” that King’s legislation could be legal.

“Sanctuary city policies are legal policies,” Schaaf said. “Part of the beauty of American democracy is that there is a balance between local, state and federal power. I know a lot more about what makes my community safe than a congressman from Iowa.”

Kimberly Veklerov is a San Francisco Chronicle staff writer. Email: kveklerov@sfchronicle.com Twitter: @kveklerov