New White House chief of staff John Kelly considered resigning as secretary of Homeland Security after he heard how President Trump fired then-FBI Director James Comey.

"John was angry and hurt by what he saw and the way [Comey] was treated," a source told CNN.

Comey learned that Trump had fired him while giving a speech to the FBI office in Los Angeles, where he saw it on television and attempted to make a joke about it before calling his office to confirm the news.

Kelly called Comey while Comey was on his way back to D.C., and Comey urged him not to resign his position. Sources said the two are not close, but that the two "had a personal relationship and deep mutual respect for each other."

Trump tweeted on Friday that he was replacing Reince Priebus as Chief of Staff with Secretary Kelly. Kelly was sworn in on Monday morning.

Comey's replacement, Christopher Wray, is expected to be approved by the Senate when it votes on the nomination soon. The Senate Judiciary Committee voted unanimously on July 20 to recommend him to the Senate as the nomination for FBI director.

Comey declined to comment for CNN's story, and the White House and Department of Homeland Security did not respond to a request for comment.