Washington (CNN) New White House chief of staff John Kelly was so upset with how President Donald Trump handled the firing of FBI Director James Comey that Kelly called Comey afterward and said he was considering resigning, according to two sources familiar with a conversation between Kelly and Comey.

Both sources cautioned that it was unclear how serious Kelly, then the secretary of homeland security, was about resigning himself.

"John was angry and hurt by what he saw and the way (Comey) was treated," one of the sources said.

Comey learned of his dismissal on May 9 from televisions tuned to the news as he was addressing the workforce at the FBI office in Los Angeles, law enforcement sources said at the time. Comey made a joke about it to lighten the mood and called his office to get confirmation.

Comey, who took Kelly's call while traveling back from Los Angeles to Washington, responded to Kelly by telling him not to resign, one of the sources said.

Read More