Shortly after Hamas militants took hostages during their deadly assault on southern Israel on Oct. 7, the government of Qatar contacted the White House with a request: Form a small team of advisers to help work to get the captives freed.

That work, begun in the days after the hostages were taken, finally bore fruit with the announcement of a prisoner swap deal mediated by Qatar and Egypt and agreed by Israel, Hamas and the United States.

The secretive effort included tense personal diplomatic engagement by U.S. President Joe Biden, who held a number of urgent conversations with the emir of Qatar and Israeli Prime Minister Benjamin Netanyahu in the weeks leading up to the deal.