WASHINGTON — As a senator, Jeff Sessions became Congress’ leading advocate not only for a cracking down on illegal immigration, but also for slowing all immigration, increasing mass deportations and scrutinizing more strictly those entering the U.S. As attorney general, he’d be well positioned to turn those ideas into reality.

Immigration laws are enforced by other agencies, but the Justice Department plays a crucial role in setting the policies and legal underpinnings that shape the system. And if Donald Trump sticks with his campaign promises, immigration will be a top priority for his administration.

As the nation’s top law enforcement official, Sessions could execute maneuvers to limit which nationalities the U.S. would accept as refugees and to reverse a federal policy that protects young people from deportation.

Get Breaking News Delivered to Your Inbox

“The president has the clear power to suspend immigration to protect America,” Sessions said during the Republican convention when he was discussing the threat of terrorism and the need to scrutinize refugees more closely.

The fourth-term Republican from Alabama was the first senator to support Trump’s candidacy, and he helped shape Trump’s positions on immigration. Sessions favors limiting the number of refugees coming into the U.S. and turning away children who arrive at the border alone who are attempting to reunite with families living in the U.S.

The attorney general can direct federal prosecutors to boost the number of criminal cases brought against immigrants caught crossing the border; guide legal opinions to defend executive actions; prioritize hiring more judges for federal immigration courts; overturn key decisions made by a federal immigration appeals panel and challenge the legality of state immigration policies.

“The attorney general has a lot of power when it comes to immigration,” said Stephen Yale-Loehr, a professor at Cornell law school. “He has a seat at the table when important decisions are being made.”

One of the most important legal opinions on immigration that came out of the Justice Department in the past eight years defended the Obama administration’s policy of formally shielding immigrants who arrive in the U.S. as children from being deported. This policy also gives those immigrants permission to work in the U.S.

Sessions and other GOP lawmakers have called this “backdoor amnesty.” The Trump White House can rescind the policy that protects these young immigrants, and as attorney general, Sessions could provide legal guidance to defend Trump’s actions, which would put more than 700,000 people at risk of being deported.

“Tweaks of the pen over there can have large implications across the country,” said Victor Cerda, a former Justice Department immigration attorney who led the Immigration and Naturalization Service after the 9/11 attacks. The agency has since become part of the newly created Homeland Security Department.

The Justice Department’s Office of Immigration Litigation, housed in the civil division, is the force behind fighting state immigration actions like Arizona’s landmark immigration crackdown that required immigrants to carry identification and invited discrimination against Latinos. The Justice Department sued the state, along with immigration advocacy groups, and won.

Given Sessions’ and Trump’s positions on immigration, it’s unlikely they’d use the department to fight such state laws.

“The courts have always paid much greater attention when the United States is a party,” said Bill Hing, a professor at the University of San Francisco law school and director of its immigration and deportation defense clinic.

Immigration advocates are preparing to go it alone.

“Private organizations are going to have to rely on their own resources to pursue these kinds of cases,” said Thomas Saenz, president and general counsel for the Mexican American Legal Defense and Educational Fund.

The Justice Department also houses the immigration court system, which for years has been woefully understaffed and amassed a backlog of more than 500,000 pending cases. The parties in the case can wait years for a final ruling. The attorney general could ask Congress for a significant increase in funds to staff the courts and blast through the backlog.

The Board of Immigration Appeals, which is the last stop in the immigration court system to challenge a judge’s ruling, is part of the Justice Department as well. The attorney general is responsible for appointing that 17-member board and can overturn a decision, which can then be challenged in federal court. The board’s decisions have widespread ramifications and are applied by judges across the country, Cerda said.

And the attorney general can influence the grants the department issues annually for a range of state and local law enforcement programs. Sessions has criticized the government for not cutting funds to cities and jurisdictions that have refused to cooperate on enforcing immigration laws. As attorney general, Sessions could push such cuts.

“For 40 years, no president and no attorney general has given a high priority to enforcing our immigration laws,” Sessions said in 2007. If confirmed by his peers in the Senate, he could change that.