WASHINGTON (TNS) — Gen. John Kelly is a lot like Donald Trump.

From his candid and sometimes foul language to his disgust for Washington politics and his disdain for the press, the retired Marine Corps general fits the president's mold.

Now it's time to see if he can fix the president's White House.

"This will be baptism by fire," former U.S. Assistant Secretary of State Philip Crowley said on Twitter on Friday.

When Kelly retired in 2016, he was the U.S. military's longest-serving general. He said his "fear" was being offered a job that forced him to "come up to the Beltway."

Now as Trump's chief of staff, he will manage a White House mired in chaos and infighting that in seven months has failed to persuade a Republican Congress to give the Republican president a single legislative victory beyond the appointment of a Supreme Court justice.

Kelly has been open about his disgust for what he called the "cesspool of domestic politics." Indeed, he has often admitted that he is uncomfortable with politics.

When Trump asked him to join his administration as secretary of Homeland Security, he "panicked for a bit," he told the Aspen Security Conference last week: "All I could think about is, how do I get out of this?"

He took the job, he says, because it fit his background, and he threw himself into his new role with rigor, earning him the highest compliment from the commander in chief, who called him a "tough guy."

But those who hoped Kelly, with his sterling military credentials, would be a moderating influence have been disappointed. Democrats who thought he would temper Trump's hard-line immigration and security policies found that he executed them with military precision. He defended the president's controversial travel ban from Muslim-majority countries and ramped up immigration arrests. He was caught on a hot mic joking that the president should use a ceremonial saber on the press.

Kelly even defended efforts by top White House adviser Jared Kushner, Trump's son-in-law, to create secret back-channel communications with Russia as a "good thing."

"I think Secretary Kelly has drank the Kool-Aid," Sen. Robert Menendez, D-N.J., said last month. "He's not the person who I thought I was voting for."

Even before joining Trump's Cabinet as secretary of Homeland Security, Kelly was Trumpian in his own way.

As commander of the U.S. Southern Command, he would openly express contempt for reporting about the U.S. terror prison at Guantanamo, a place he visited frequently to show his devotion to the troops.

He would exclude civilian media from typically open ceremonies installing new commanders, then use the podium to call reporters liars.

In one such event in July 2015, in an audiotape released by the Pentagon, he told troops at a chapel ceremony that media coverage of the terror prison "breaks my heart because I know the reporting is wrong, and I believe the media representatives that report what goes on here know it's wrong but they go on their merry way highlighting the negative aspects of what might go on at Gitmo, never giving you credit for what you do here."

And he would portray the conflict with the captives, even those long ago cleared for release, as a classic clash between good and evil. "We take care of them in a way that is more than in my opinion what they deserve," he told troops at Guantanamo in November 2015. "But we take care of them in a way that shows the world, and certainly those guys, that we're the good guys and they're the bad guys."

The plain-spoken approach, and unwavering support, earned him the adoration in particular of enlisted troops. And, although diplomatic in his public statements, he would use foul language in more intimate conversations, privately at one point describing a female reporter who he believed disrespected his troops an "a..hole."

Kelly is close to the chairman of the Joint Chiefs of Staff, fellow Marine Gen. Joseph F. Dunford Jr., a fellow Bostonian who in 2010 took on the task of donning a service uniform and knocking at Kelly's then Washington Navy Yard home to notify him that his son Robert was dead. The 29-year-old Marine Corps lieutenant was killed in an explosion while leading Marines on a dismounted patrol in Afghanistan. Kelly was the highest-ranking military officer to lose a son or daughter in Iraq or Afghanistan.

He is known for his loyalty, particularly to those in the Corps, but also was seen as a devoted senior military adviser to Secretary of Defense Leon Panetta, his second to last job in the U.S. Marine Corps, after serving multiple deployments in Iraq.

The last general to serve as White House chief of staff was Alexander Haig, a former U.S. Army general who served under President Richard Nixon.