White House Chief of Staff John F. Kelly has had a rough month — a rough tenure, even — and on Thursday, he told a joke about it that didn't exactly seem like a joke.

Appearing at an event marking the 15th anniversary of the Department of Homeland Security, which he led for six months before President Trump tapped him as chief of staff, Kelly began by telling the crowd, “I miss every one of you, every day.”

When the moderator and some in the crowd read more into that comment than perhaps he intended and began laughing, Kelly rolled his eyes briefly and gave a chuckle.

Then he offered this: “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.”

Look: It was clearly intended as a joke. Kelly smiled when he said it. And it had the intended effect.

But as with all sarcasm, there was more than a hint of truth in that statement. Since becoming chief of staff, Kelly has been thrust into a controversy over Trump feuding with a Gold Star family — a situation that led him to tell a false story about Rep. Frederica S. Wilson (D-Fla.). More recently, Kelly offered a passionate and ill-advised defense of a close aide, Rob Porter, just before Porter was forced to resign in the face of abuse allegations by his ex-wives. Then Kelly told White House staff members to offer a version of events of the Porter resignation that some of them regarded as false. This has all led to speculation that Kelly is a short-timer in the White House.

There are also myriad examples of Trump being extremely hard on his staff and Cabinet members, through what he does and even says publicly about them. Just this week, Trump went after Attorney General Jeff Sessions again.

Against that backdrop, Kelly had to know how this comment would be perceived. The crowd made that pretty clear right when he started speaking, and he decided to go along with it.