At the Mexican consulate in St. Paul, Caroline Brown told families what to do during run-ins with immigration agents: Don't open the door unless agents slip a warrant under it, and don't answer questions if detained.

"With the president we have, it's very important to know your rights," Brown, a case manager of Zimmer Law Group, said in Spanish.

Along with its usual work of issuing passports and birth certificates, the consulate has unleashed an unprecedented effort this year to respond to immigration changes under the Trump administration.

As part of a $50 million Mexican government initiative, the consulate teamed up with attorneys to offer workshops about immigration enforcement and screenings to check whether some Mexican citizens could gain legal status.

The consulate has chipped in for a nonprofit's campaign to urge permanent residents to seek citizenship. It lobbied the state's congressional delegation to support a citizenship path for youths who arrived illegally as children.

Consul Gerardo Guerrero says the effort is in keeping with a more muscular, politically active role for Mexican consulates that predates Trump's election.

"We are not trying to get involved in the politics of the United States," he said. But, he added, "It's the moral duty of the Mexican government to support its people."

The St. Paul consulate estimates about 185,000 Mexican citizens live in Minnesota. An estimated 60,000 of them lack legal status.

Within days of Trump's election on a platform of ramping up immigration enforcement, the Mexican government announced a 24-hour hot line for its citizens in the United States. It beefed up help for newly arrived deportees and approved $50 million for consulates to help those facing deportation and others. About $100,000 of that went to the St. Paul consulate, which also covers the Dakotas and western Wisconsin.

In Minnesota, the consulate has worked with immigration lawyers for years, tapping the nonprofit Immigrant Law Center and private law firms to provide subsidized legal services to low-income Mexican citizens.

But, Guerrero notes, this year brought a profoundly different climate. By spring, the consulate had seen a 50 percent increase in traffic compared to mid-2016, when Guerrero took over as consul. Residents sought Mexican birth certificates for their children, in case the family is deported, and consular ID cards, recognized by most Minnesota police departments. The consulate fielded anxious questions about immigration enforcement.

Guerrero says that, thanks to an "excellent" line of communication with local Immigration and Customs Enforcement, he has been able to reassure constituents that the agency's focus remains people with criminal convictions and existing deportation orders. That might change as the government steers more resources to ICE, he says.

This year, the consulate opened its Center for Legal Defense and contracted with the Immigrant Law Center and two law firms on a new information campaign. Brown's recent overview was among more than 10 Know Your Rights workshops the St. Paul-based Zimmer Law has held this year. Attorney Julie Carlson says she assures attendees that local law enforcement agencies do not act "like Gestapo."

"Sometimes we serve as social workers," Carlson said. "It's really about talking people off the ledge."

During Brown's presentation, Minneapolis attorney Iris Ramos met with attendees one-on-one in a consulate office. She has screened more than 100 people to see if they could legalize their status. For many, she says, there are no options. But she finds some might have a path to permanent residence, such as a visa for crime victims who cooperate with law enforcement.

The consulate also supports the Immigrant Law Center's work to encourage citizenship. That recent morning, legal assistant Blanca Rangil met with Miguel Sanchez of Cottage Grove to make sure he qualified. Sanchez, a legal permanent resident for almost a decade, says as a busy single dad, he never got around to applying. This year, with his green card renewal looming, he decided it was time. His mother heard at church he could get help with his citizenship application at the Mexican consulate. "I didn't expect this kind of help," he said.

In total, the consulate and its partners have hosted 35 workshops attended by about 700 people in the Twin Cities, greater Minnesota and neighboring states. Guerrero, who gave talks about the benefits of NAFTA after Trump threatened to scrap the treaty, says it comes down to Mexico's embrace of "consular diplomacy": a more active role for local consulates.

"The instructions that we have are that we also need to do a political job at the local level," he said. "We are little embassies here."

After the administration announced it would phase out Deferred Action for Childhood Arrivals, an Obama deportation reprieve, the consulate again sprang to action. For some low-income recipients, it covered fees to renew work permits by an October deadline, and it hosted informational sessions.

This proactive approach has drawn some criticism. By some estimates, Mexicans account for about half of those living in the United States illegally. In a recent critique on the conservative website Breitbart, former Colorado U.S. Rep. Tom Tancredo, an immigration hard-liner, said the consulates' efforts present a more serious threat than Russia's election meddling.

Guerrero said he often hears from mayors and others in outstate Minnesota that their communities rely on immigrant workers, especially for agricultural jobs.

The Mexican government is now weighing whether to review funding for this initiative next year. Meanwhile, says Guerrero, some of the early panic has subsided.

"Many months have passed," he said. "People really need to calm down and live their lives."

Mila Koumpilova • 612-673-4781