White House chief of staff John Kelly joked Thursday that leaving his post as secretary of the Department of Homeland Security for his current position was the result of God’s wrath.

“I miss every one of you, every day,” Kelly told attendees with an eye roll during a celebration of DHS’ 15th anniversary. Kelly became DHS secretary when Trump took office, and took over the White House chief of staff position from Reince Priebus six months later. Kelly had earlier commanded the United States Southern Command through early 2016.

Kelly continued Thursday: “Truly, at six months, the last thing I wanted to do is 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 has faced a tumultuous tenure, most recently due to a spate of senior staff departures: White House Staff Secretary Rob Porter resigned earlier this month after allegations (and photos) of spousal abuse went public. The FBI later said it had told the White House months ago about the allegations, increasing scrutiny over why Kelly hadn’t acted sooner.

And White House Communications Director Hope Hicks announced Wednesday that she would soon resign from that position, one day after an interview with the House Intelligence Committee.

Watch below via ABC News:

Chief of Staff John Kelly: “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.” pic.twitter.com/t3ofEumKAi — ABC News (@ABC) March 1, 2018

This post has been updated.