Sen. Jeff Sessions is on record saying so-called “sanctuary cities” that protect illegal immigrants should be prosecuted. He himself may get that chance next year.

Mr. Sessions is president-elect Donald Trump’s pick to be the next attorney general, and if he’s confirmed — a very large if, at this point — he will mark a 180-degree turn from the Obama administration on a host of issues, but nowhere more so than on immigration, where he’s been the Senate’s leading crackdown proponent.

From his first day in office, Mr. Sessions will have the power to strip some federal funding from sanctuary cities, thanks to rulings this year by the Justice Department’s inspector general, who said federal law requires localities to cooperate with immigration agents — and who provided an initial list of a handful of the worst offenders.

“The sanctuary cities thing is huge. I think most jurisdictions are going to fold like a cheap suit,” said Rosemary Jenks, government relations manager at NumbersUSA, which lobbies for stricter immigration laws.

Some sanctuary cities have already said they’ll resist any effort to change their behavior. They are being prodded by immigrant rights advocates who are calling on Senate Democrats to deny Mr. Sessions the chance to be attorney general, saying he represents a massive step backward for the Justice Department.

“The agency would become the dispenser of terror and racial intolerance should Jeff Sessions be confirmed,” said Brent Wilkes, executive director of the League of United Latin American Citizens.

Other advocates stopped just shy of calling Mr. Sessions a member of the Ku Klux Klan.

“The handful of people who might be even less equipped than Jeff Sessions to dispense justice on behalf of the American people typically spend their weekends wearing pointy hats and burning crosses,” said Charles Chamberlain, head of Democracy for America, a liberal pressure group.

Mr. Sessions was a strong ally of Mr. Trump during the presidential campaign, and was given his pick of posts as a reward. He was deciding between defense secretary and attorney general, and late last week he went with the latter.

“He is a world-class legal mind,” Mr. Trump said in nominating him.

Democrats are already signaling a bruising confirmation fight, saying that even though he’s a senator — a position that usually secures speedy approval — they’ll put him through the wringer because of his staunch conservative positions.

It won’t be Mr. Sessions’ first time. In 1986 then-President Reagan picked him to be a federal district judge, but Democrats, joined by several Republicans, accused him of racist tendencies during his time as U.S. attorney, and scuttled his nomination in the Judiciary Committee.

A decade later he ran for the Senate himself and won his seat, serving alongside Sens. Edward M. Kennedy, Joseph R. Biden, Arlen Specter and Patrick J. Leahy — each of whom played a role in blocking his judgeship.

Mr. Specter, a Republican-turned-Democrat, later said he regretted his vote against Mr. Sessions. Mr. Leahy is the only one of those opponents still in the Senate.

As attorney general, Mr. Sessions would oversee criminal prosecutions, reviews of states’ voting rights and elections policies, the FBI and drug and firearms law enforcement and the government’s open records policies.

He would also be the chief decider for legal strategy, and legal scholars said they expect him to halt the Obama administration’s practice of “sue-and-settle,” where agencies whose hands are tied invite a lawsuit from interest groups, then quickly agree to settle the case.

Sue-and-settle has been most prominently used by environmental groups who sue the Environmental Protection Agency, forcing new regulations and environmental restrictions that would otherwise have trouble getting through the bureaucracy.

The next attorney general would also control the burgeoning field of immigration law, which has been greatly tested under President Obama.

Over the last eight years, federal judges have ruled that illegal immigrant children need to be quickly set free and have ruled localities don’t need to hold illegal immigrants even when federal agents ask them to.

Meanwhile, immigration judges — those who hear immigration and asylum cases — have expanded the universe of people who are being granted status in the U.S.

Ms. Jenks said Mr. Sessions as attorney general couldn’t tell immigration judges how to rule, but he could influence how the department views cases in the broader sense. And he can choose to fight the federal judges who keep expanding the rights of illegal immigrants by appealing those cases in instances where the Obama administration didn’t.

“He will have influence over the kind of culture throughout the department,” Ms. Jenks said. “I think he knows where the bodies are buried at the Justice Department. I think he will have the right advisers so he can really clean house.”