At a refueling stop in Cape Verde on his way home from an exhausting visit across Africa, Secretary of State Rex W. Tillerson walked through howling winds late Monday night toward the airport’s V.I.P. terminal, where he pulled up a chair and started telling jokes to the reporters who had traveled with him.

He was fired by executive tweet just hours later.

By the time Mr. Tillerson again spoke to reporters, on Tuesday afternoon in Washington, the man who had strode confidently and relaxed throughout the weeklong diplomatic trip was replaced by a humbled and emotional one who nearly choked up as he announced that he would be handing off his powers at the stroke of midnight.

Some senior administration officials said Mr. Tillerson — who in nearly 14 months at the State Department had departed from President Trump’s policies on the Paris climate accord, the Iran nuclear deal and diplomacy with North Korea — should have seen it coming.