LOS ANGELES — Gov. Gavin Newsom of California announced Monday that he would withdraw nearly 400 of his state’s National Guard troops from deployment along the border with Mexico and assign them to other duties.

The step to rescind state authorization for the border deployment is a sharp rebuke of President Trump’s continued warnings that undocumented migrants present a national security risk to the United States. It follows a similar move last week by Gov. Michelle Lujan Grisham of New Mexico.

Under a “general order” that Mr. Newsom plans to sign, 110 California National Guard troops will be redirected to support the state’s central fire agency, Cal Fire, and another 100 will work on statewide “intelligence operations” aimed at international criminal drug gangs.

Mr. Newsom is also seeking to expand the state’s Counterdrug Task Force with 150 National Guard troops, which would require funding from the Department of Defense.