WASHINGTON — Treasury Secretary Steven Mnuchin is seeking to wrest control of the Secret Service from the Department of Homeland Security and has been lobbying President Trump to back such a move, according to administration officials.

The discussions between the Treasury Department, the White House and high-ranking Secret Service officials have taken place over the past year and have intensified in recent months, as Mr. Trump has pressed homeland security officials to focus on stemming immigration and ousted some for failing to do so.

The president supports the idea of moving the Secret Service back to the Treasury Department, where it was housed until 2003, according to people familiar with the discussions. The agency, which had been part of Treasury for more than 100 years, was transferred as part of the Homeland Security Act, which sought to consolidate security agencies after the Sept. 11, 2001, attacks.

Some senior officials at the Department of Homeland Security have been pushing back against the move, concerned about losing an agency that has cybersecurity and investigative components. The department, which oversees the Cybersecurity and Infrastructure Security Agency, is responsible for protecting the country against cyberattacks and ensuring election security, in addition to enforcing immigration law.