WASHINGTON — President-elect Donald J. Trump’s selection of Gen. James N. Mattis as defense secretary signals a more assertive American posture in the Middle East — one that people close to him say would most likely include more American troops on the ground in Iraq and Afghanistan, more Navy patrols in the Persian Gulf and more fighter jets in the Middle East.

“The closest thing we have to Gen. George Patton,” Mr. Trump said in announcing his selection on Thursday night. At first glance, the similarity is there: Like General Mattis, General Patton, who led American troops into Nazi Germany during World War II, was a colorful, hard-charging advocate of aggressive offensive action.

But officials who know General Mattis caution that he views a tough American posture overseas as something to deter war with potential foes like Iran, not to start one. And although he was so hawkish on Iran as head of United States Central Command from 2010 to 2013 that the Obama administration cut short his tour, General Mattis has since said that tearing up the Iran nuclear agreement, as Mr. Trump has vowed to do, would hurt the United States.

General Mattis now favors working closely with allies to strictly enforce the deal.

“I don’t think that we can take advantage of some new president, Republican or Democrat, and say we’re not going to live up to our word on this agreement,” General Mattis, a retired Marine, said in April. “I believe we would be alone if we did, and unilateral economic sanctions from us would not have anywhere near the impact of an allied approach to this.”