Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

John Kelly, the new White House chief of staff, is a retired four-star Marine general who served in the military for over four decades.

Kelly, 67, one of the nation's longest-serving commanders, came into Donald Trump’s orbit because of positions on terrorism and immigration that mirrored the president's. He equates leaks, which have plagued the administration, with treason and knows how to work the halls of Congress, which the White House has also had trouble doing.

Trump named Kelly as his chief of staff Friday afternoon in the administration's latest shakeup. Kelly was not involved in the 2016 campaign and didn't support any of the candidates. He said only that he would be happy to serve in a Republican administration.

Kelly, 67, was born in Brighton, a working-class Boston enclave that he described to NPR in 2015 as a "very, very, very Marine town."

"So, back in my neighborhood in Boston, a working-class neighborhood, when you got your draft notice, you went down, and you took your draft physical. And then, if you passed it, you joined the Marine Corps," he told NPR.

And he did just that. In 1970, Kelly enlisted in the Marines. By 1972, he was discharged as a sergeant and enrolled at the University of Massachusetts, according to an online biography. After graduating he went right back into the military, serving a storied four-decade career, garnering respect from both sides of the political aisle and admiration from military officers.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

He led the Southern Command, where he oversaw U.S. military operations in South and Central America, including the southern border, and he formed a tough immigration stance.

"The border is, if not wide open, then certainly open enough to get what the demand requires inside of the country," Kelly told the House Armed Services Committee in 2015.

He doubled down on that sentiment earlier this year when he appeared before the House Homeland Security Committee and said he believes that "smugglers" were bringing "tens of thousands of people to our nation’s doorstep" from across the border "mostly from Central America and Mexico."

"As a nation, control of our borders is paramount," he added.

When Trump tapped Kelly to lead Homeland Security he called him "the right person to spearhead the urgent mission of stopping illegal immigration and securing our borders."

Kelly also commanded Marines during some of the most intense fighting during the Iraq war, in which two of his sons also served.

In 2010, one of Kelly’s sons, Marine 1st Lt. Robert Michael Kelly, 29, was killed in combat in Afghanistan after stepping on a land mine, making Kelly the highest-ranking military officer to lose a child during the wars in Iraq or Afghanistan. Kelly’s wife, Karen, started a scholarship in her son’s name.

The commander of the US Southern Command, General John Kelly (C) arrives at the Guatemalan Air Force base on March 2, 2015 in Guatemala City. File Johan Ordonez / AFP/Getty Images file

In picking Kelly, Trump may also be betting on getting his agenda through Congress more effectively.

In 2004, Kelly came back from a two-year command position in Iraq and served as the legislative liaison for the Marines until 2007, before retiring in 2015 from the military.

Since Priebus’ fate was tied the failure of congressional Republicans to repeal Obamacare, a source told NBC News, Kelly’s ability to rub elbows with lawmakers could be a plus for the White House.

Aside from being in lockstep with Trump on immigration matters, he has also sided with the president on sensitive issues, such as leaks, which have riled the administration on multiple occasion.

Kelly told Meet The Press earlier this year intelligence leaks were "darn close to treason."

In the same interview, he also defended the president on Russia, particularly a report that indicated White House Senior Adviser Jared Kushner had proposed a secret communication channel with the Kremlin so that discussions before the inauguration could not be detected.

"I don’t see any big issue here relative to Jared," Kelly said of the report, which Kushner also has since denied.