WASHINGTON — Defense Secretary Jim Mattis said on Wednesday that American troops stationed at the southwest border would not be armed with guns to confront incoming migrants, despite a White House directive that aims to protect border security officials by pairing them with military forces.

The White House memo seeks to expand the mission of the troops at the border to also include duties such as crowd control and temporary detention. But Mr. Mattis said it left the final decision on what American soldiers and Marines could do — and could not — to the defense secretary.

Mr. Mattis mentioned one possible instance in which troops might act: defending a border agent who was hit by a rock, and detaining the migrant who threw it. But asked whether such a situation might call for the American soldier to be armed, the defense secretary unequivocally said it would not.

“No,” he said. “Not with a firearm.”

Sent to the Pentagon on Tuesday night, the memo was signed by John F. Kelly, the White House chief of staff, not President Trump. It is the latest in a series of White House directives to prod active-duty troops toward a more aggressive role at the border against an approaching caravan of thousands of migrants from Central America.