Illegal immigration was the centerpiece of Mr. Trump’s presidential campaign, drawing large crowds as he promised to build a border wall and deport millions in the country illegally. But security experts said the country faces a number of continuing threats ranging from domestic terrorists to attacks from political extremists and cyberattacks against the nation’s election systems that demand the full attention of the Department of Homeland Security.

“John Kelly and his staff have a wide portfolio,” said Tom Ridge, who served as the first Homeland Security secretary, under President George W. Bush. “I hope the White House realizes that they have an enormous job in protecting the border and the nation’s infrastructure from cyberattacks. They can’t be used just to keep campaign promises.”

The budget proposal Mr. Trump submitted to Congress prioritizes agencies and programs that target illegal immigration.

Under the plan, funding would increase just over 21 percent for Customs and Border Protection, the parent agency of the Border Patrol. Much of the increase would be used to build a border wall. But the agency would also be charged with hiring 5,000 new Border Patrol agents, even as the number of people crossing the border illegally has declined. Last month, 21,659 border crossers were caught, compared with 45,722 in June 2016, a 53 percent decrease.

Immigrations and Customs Enforcement’s budget would increase even more, nearly 30 percent. The new funding would pay for more deportation officers, detention centers and money to fly or bus unauthorized immigrants back to their home countries.

But other services and programs within Homeland Security would have their funding cut. The proposed budget includes cuts to the Coast Guard, elimination of the Transportation Security Administration’s teams of uniformed armed officers that sweep public facilities and shutdowns of several of the department’s national labs, including one in New York City that helps detect nuclear radiation. Several grant programs that pay for local police officers in airports or those that fight extremism would be cut or reprogrammed.