WASHINGTON — The Trump administration is considering Jim Webb, a former Democratic senator and Reagan-era secretary of the Navy, to be the next defense secretary, according to three officials, potentially bypassing more hawkish Republicans whose names have been floated to replace Jim Mattis.

Mr. Webb, an outspoken opponent of the Iraq war, is being considered as President Trump seeks to carry out campaign promises to withdraw American troops from Syria and Afghanistan.

Those two decisions prompted Mr. Mattis to resign late last month, putting the deputy defense secretary, Patrick M. Shanahan, a former Boeing executive, in the top role in an acting capacity.

Representatives for Vice President Mike Pence and Mick Mulvaney, the acting White House chief of staff, have reached out to Mr. Webb, one of the three officials said. Separately, a senior Defense Department official confirmed that Mr. Webb’s name had been circulating at the White House. Those two and the third official all spoke on the condition of anonymity to describe the internal discussions.