Trump tweeted Friday that retired Marine Corps general Kelly had "done a spectacular job at Homeland Security".
Mr Kelly is now the secretary of homeland security and Mr Trump tweeted that he "has been a true star of my administration".
Kelly, who has a reputation for speaking truth to power and holding informed and nuanced views, is taking over the role from former Republican National Committee head Reince Priebus, who seemed incapable of reining in his mercurial boss. He told reporters that Priebus was "a good man", and thanked him for his service.
"I congratulate Secretary Kelly on his appointment, and look forward to working with him to advance our agenda", he said.
The background photo on Scaramucci's Twitter page shows him standing behind a seated Trump in the Oval Office, with both smiling broadly.
Wisconsin Republicans are not happy with the departure of Reince Priebus as President Donald Trump's chief of staff.
The Washington Post's David Nakamura spotted Priebus on the tarmac in Suffolk, New York, earlier in the day. I'll get to the person who leaked that to you. "I can tell you two fish that don't stink, and that's me and the president". Scaramucci, in a since-deleted tweet, suggested that the release of his financial disclosure form could be prosecuted as a felony.
But, he added, "when you lose one in combat, there's a - in my opinion - there's a pride that goes with it, that he didn't have to be there doing what he was doing".
As of Friday, Trump had 51 presidential appointees confirmed and another 255 nominated. I support the president, and I support [incoming White House Chief of Staff] John Kelly and the president's agenda. Shortly after, he tweeted that his financial disclosure information had been illegally leaked and he was calling on the Federal Bureau of Investigation and Department of Justice to investigate, ending the tweet by tagging Priebus.
Scaramucci subsequently deleted that original tweet and wrote another one that featured a screengrab of a news story with the headline, "Scaramucci appears to want Priebus investigated by FBI".
"It has been one of the greatest honors of my life to serve this President and our country. John Kelly is one of our great stars".
"I think the president wanted to go a different direction", Priebus said.
House Speaker Paul Ryan, who, like Priebus, is from Wisconsin, issued a statement that gushed praise on Preibus, but was guarded about Kelly.
Trump, however, is yet to roll out his catchphrase "You're fired!" and Sessions said that while the president's comments were "kind of hurtful", he would continue to serve.
Asked what he meant by including Priebus, Scaramucci said, "If Reince wants to explain he's not the leaker, he can do that".