DOHA, Qatar — In the violent flux of the Middle East, Khaled Meshal is one of the great survivors. Down the years other senior figures in Hamas, the Islamist militant group that resists Israel, have died in hotel rooms at the hands of Israeli assassins or been crushed by laser-guided missiles during the wars in Gaza.

Mr. Meshal, who spent his career shifting from one Arab capital to another, had his own close scrape: In 1997, a year after he became the leader of Hamas, Israeli spies sprayed poison into his ear on a street in Jordan, sending Mr. Meshal into a coma and setting off an angry diplomatic showdown between Jordan and Israel that ended with the delivery of a lifesaving antidote.

Now Mr. Meshal is stepping down as the senior leader, ending a 21-year reign during which Hamas grew into a formidable military force and also joined politics to rule Gaza for the past decade. Yet it has become an international pariah for its attacks on civilians.

Mr. Meshal’s parting shot is a new political document, released at a luxury hotel in Doha on Monday, that he is pitching as an attempt to pull Hamas from its isolation by presenting a friendlier face to the world.