I met Jim Mattis in Anbar Province, Iraq, in 2004. He was a major general, commanding the First Marine Division in a tough counterinsurgency fight. I was an Army major, serving in a tank battalion that the Army had provided to the Marines to give them extra firepower.

On the way to the rehearsal for a sweep-and-clear operation, General Mattis’s ground convoy was ambushed, with at least one of the Marines on his personal protection detail seriously hurt. Generals usually took helicopters, but General Mattis wanted to see the terrain for himself, from a grunt’s perspective, and the talk among the junior officers was of his personal courage in the battle with insurgents that followed the ambush. We were also impressed by the way he improved the operation plan. He had apparently always been full of ideas, and vocal about them, so one of his previous commanders had dubbed him Chaos, short for “Colonel Has Another Outstanding Suggestion.” Nobody called him Mad Dog.

I later had the privilege of fighting another battle with General Mattis, who by 200 5 was a three-star general leading the Marine Corps’ Combat Development Command, responsible for the thinking side of war. General Mattis worked with David Petraeus, then a three-star general in the Army, in the writing of the Army and Marine Corps’ Counterinsurgency Field Manual, on which I played a junior role. General Mattis, known as the “Warrior Monk,” had a personal library of 7,000 volumes on war and strategy; he gave as good as he got from General Petraeus, who holds a doctorate from Princeton University. The two created a revolutionary manual that changed how the Army and the Marines thought about conflict — and how they fought the wars in Iraq and Afghanistan.

After retiring from the Army, I shared an office with a former Marine named Nate Fick who had participated in the invasion of Afghanistan immediately after the attacks of September 11. Nate told me about checking his foxholes at zero -dark-thirty one morning, expecting to see two Marines awake and one sleeping in each hole. He saw three heads up in one of his foxholes, and crawled over to investigate. One belonged to Brigadier General Jim Mattis, the senior Marine commander in southern Afghanistan, who had decided to spend the night checking holes himself. Marines apparently don’t sleep much.