WASHINGTON (AP) — In November 2012, shortly before the White House ended his tenure commanding U.S. forces in the Middle East, Marine Gen. James Mattis delivered an urgent message to his boss: An Iranian fighter jet had fired errantly on a U.S. drone overflying the Persian Gulf.

In considering how the U.S. should respond, Defense Secretary Leon Panetta took into account a central feature of Mattis's reputation: his nerve.

"I could sense that Mattis did not want to back down," Panetta recounted in his memoir, "Worthy Fights." ''And that the White House was wary of his resolve. As I already knew, the White House didn't fully trust Mattis, regarding him as too eager for a military confrontation with Iran."

The crisis faded. But Mattis now stands on the brink of becoming Pentagon chief for a president-elect who has pledged to toughen U.S. policy toward Iran. And that could have broad implications as the incoming administration weighs trying to modify the 2015 Iran nuclear deal and American posture in the Middle East after a litany of complaints from U.S. allies that President Barack Obama yielded too much ground to Tehran.

Having retired in 2013, Mattis would be the first career military officer to serve as defense secretary in more than a half-century. He will testify Thursday before the Senate Armed Services Committee, which is expected to broadly approve his nomination.

First, there are formalities before he can be installed. Congress will have to approve a one-time exception to a law requiring a military officer to be out of uniform for at least seven years before becoming defense secretary. Even some of Donald Trump's strongest critics say Mattis merits the exception.

Eliot A. Cohen, a senior State Department counselor in George W. Bush's administration who has publicly criticized the incoming Trump team, told a Senate hearing Tuesday that he feels a "sense of alarm" about the judgment of the incoming administration. Mattis, he said, "would be a stabilizing and moderating force, preventing wildly stupid, dangerous or illegal things from happening."

Mattis, 66, is one of three recently retired senior generals selected by Trump for top jobs in his administration. Michael Flynn, who left the Army as a lieutenant general in 2014 after a tumultuous tenure as the Defense Intelligence Agency's director, is Trump's national security adviser; Marine Gen. John Kelly, who retired in 2016, was chosen to head the Department of Homeland Security.

Mattis could attract top-notch talent to the Pentagon, said Richard Fontaine, the Center for a New American Security's president.

"He has a reputation as a leader of exceptional integrity who inspires his subordinates and speaks truth to power," Fontaine said in an email.

After retiring, Mattis joined the Hoover Institution, a conservative-leaning think tank. He also is a member of the board of directors of General Dynamics, the big defense contractor.

He has remained outspoken in his concerns about Iran. In remarks last April at the Center for Strategic and International Studies, Mattis called Iran "the single most enduring threat to stability and peace in the Middle East."

Although he is best known as a battle-hardened combat officer who served in Afghanistan and Iraq, Mattis also has worked behind the scenes with senior civilian officials at the Pentagon. As a colonel in the mid-1990s he was the executive secretary in the office of two defense secretaries, William Perry and William Cohen. Later, Mattis was senior military assistant to Rudy DeLeon while he was deputy secretary of defense.