WASHINGTON — President Trump said on Friday that he withdrew his nominee to run Immigration and Customs Enforcement because he wanted the agency to go in a “tougher” direction, a surprise decision before the president’s trip to the southwestern border.

Ronald D. Vitiello, who was nominated last summer by Mr. Trump to run ICE, the agency that arrests, detains and deports people who are in the United States illegally, has been serving as the agency’s acting director since last June. He had planned to accompany the president on his trip to California, but was left behind.

“Ron’s a good man, but we’re going in a tougher direction,” Mr. Trump said to reporters as he left the White House en route to Calexico, Calif.

Mr. Vitiello’s nomination had been awaiting approval by a second Senate committee and confirmation by the full chamber. In an email to ICE employees on Friday afternoon, he signaled that he planned to remain at the immigration agency. No replacement has yet been named.