Legendary Marine Corps Gen. James “Mad Dog” Mattis has emerged as the top choice for President-elect Donald Trump’s secretary of Defense. However, he faces one big obstacle: The law requires those who serve in this post be retired from active-duty military service for seven years prior to appointment. Because Mattis retired in 2013, he would need Congress to make a legislative exemption for the time requirement.

Per Title 10 of the U.S. Code, the Secretary of Defense needs to be “appointed from civilian life by the president. A person may not be appointed as Secretary of Defense within seven years after relief from active duty as a commissioned officer of a regular component of an armed force.”

There is a historical precedent for such an exemption. Army Gen. George Marshall, appointed in 1950, served as Secretary of Defense five years after leaving the Army to be secretary of State. At the time of his appointment, he was subject to The National Security Act of 1947, which barred any person from the post of secretary of Defense who had served as an officer in the armed forces during the past 10 years. His confirmation was ultimately secured through the passage of the George C. Marshall Exemption Act.

Though the National Security Act of 1947 was replaced by Title 10, the process in the event of a Mattis appointment would be similar. Essentially, rather than alter the language in U.S. Code, Congress would need to introduce an individual act to exempt him, and it would have to pass in both chambers before being signed into law by the president, according a staffer on the House Armed Services Committee.

Mattis, a highly decorated and revered leader in the eyes of the Marines and many in the military, will likely have no trouble getting approval from the new Republican Congress. His 44-year career culminated in 2010 when he served as the head of U.S. Central Command, managing conflicts across the Middle East, North Africa, and Central Asia until his retirement. Since he left the Marine Corps, Mattis has been an outspoken critic of President Barack Obama’s stances on Iraq, Iran, and refusal to take offensive military positions in a number of global conflicts.

After meeting with Mattis on Nov. 19, Trump proclaimed him to be “the real deal.”

However, a number of other prominent military leaders are reportedly still in contention, including former CIA director and Army general David Petraeus, and the former head of SOUTHCOM, Marine Gen. John Kelly.