Kelly: I didn't want to leave DHS, but 'God punished me'

White House Chief of Staff John KellyJohn Francis KellyMORE joked on Thursday that he didn’t want to leave his position at the Department of Homeland Security (DHS), but “God punished me.” 

“The last thing I wanted to do was walk away from one of the great honors of my life, being the secretary of Homeland Security, but I did something wrong and God punished me, I guess,” Kelly said at an event marking DHS’s 15th anniversary. 

President TrumpDonald John TrumpAccuser says Trump should be afraid of the truth Woman behind pro-Trump Facebook page denies being influenced by Russians Shulkin says he has White House approval to root out 'subversion' at VA MORE in July 2017 appointed Kelly as his chief of staff, moving him to the White House from his position at Homeland Security.

Kelly said he felt he had “no right” to sit on stage with other former DHS leaders, and told the crowd of department staffers he missed them “every day.”

"I wish I had worked harder in the six months I had in the job to not only better protect the men and women that get beat up so badly every day, but to really advertise in a much more effective way how good you are," Kelly said.

Kelly, a retired Marine general, was appointed to lead DHS in January 2017, but only served in that role for six months before he was tapped to replace Reince PriebusReinhold (Reince) Richard PriebusPriebus on chaos in Trump White House: ‘Take everything you’ve heard and multiply it by 50’ Speculation swirls about Kevin McCarthy’s future Priebus claims he helped stop Trump from firing Sessions MORE at the White House. 

Speculation has swirled at times that Kelly would quit or be fired, and he would be one in a double-digit line of staffers leaving the White House amid tensions with the president. Trump has consistently praised Kelly for doing a "fantastic job," including as recently as January.

 "Thank you to General John Kelly, who is doing a fantastic job," he tweeted. 

However, Kelly has faced heightened scrutiny in recent weeks for his handling of domestic violence allegations against ex-White House staff secretary Rob Porter.

Porter resigned in February after reports emerged that his two ex-wives accused him of domestic abuse. Kelly reportedly knew about the abuse allegations before they became public and initially continued to defend Porter after the first reports came out.

Kelly has not explained why he did not cut ties with Porter after the FBI notified the White House about the allegations that turned up during the staffer's background check.

He later said the matter was "all done right."