The late King Hussein of Jordan was an unlikely prospect for political and physical longevity. As a teenager, Hussein was at the side of his grandfather, King Abdullah I, when an assassin’s bullet felled Abdullah in 1951. The gunman reportedly also fired at Hussein, whose life was spared when the bullet struck a medal on his uniform. A year later, when his schizophrenic father abdicated, Hussein became king at the age of 16. Four years into his reign, under pressure to prove he was in charge, he dismissed the British officers still in Jordan. The young monarch was on his own, in charge of a country independent of Britain since 1946, with few resources and no security service, and surrounded by stronger rivals and adversaries.

In 1958 the FBI intercepted conversations revealing an Egyptian-backed plot enlisting Jordanian army officers to overthrow Hussein. Jack O’Connell, a 36-year-old CIA officer, was dispatched to Amman to work with loyal Jordanians to forestall the coup. As O’Connell recounts in his memoir “King’s Counsel,” this primarily meant working with the king himself, who personally ran what passed for Jordanian intelligence operations. The coup plot was countered, thus cementing a relationship in which Hussein relied on the CIA not only for intelligence vital to his own security but also as his principal conduit to the U.S. government and a partner in his diplomatic endeavors.

The episode also marked the start of an extraordinary four-decade relationship between Hussein and O’Connell, who returned to Amman in the 1960s for an eight-year tenure as the CIA’s chief of station. He defined his mission as keeping the king in power while not becoming too visible an influence himself. The relationship continued after O’Connell left government service in the 1970s and entered law practice in Washington. From then until Hussein’s death in 1999, he functioned not only as the king’s legal counsel but as an all-purpose adviser and U.S.-based problem-solver.

It thus was natural for Hussein in his last years to turn to O’Connell for assistance in telling what the king regarded as an insufficiently understood story of his peace-making efforts in the Middle East — efforts that included secret talks with Israeli officials even before the 1967 war in which Israel seized the West Bank from Jordan. O’Connell fulfills the king’s wishes in this memoir completed just before his own death last year.

O’Connell’s admiration for his longtime royal friend is clear and unsurprising. He attributes Jordan’s successes, compared with the universal low expectations for the country in the 1950s, to Hussein’s political instincts and perseverance. But the book is not an advocate’s brief. O’Connell also identifies Hussein’s misjudgments, the most serious of which was to throw his lot in with Gamal Abdel Nasser and the Egyptians for the sake of Arab solidarity prior to the 1967 war.

‘King's Counsel: A Memoir of War, Espionage, and Diplomacy in the Middle East’ by Jack O'Connell & Vernon Loeb. Norton. 266 pp. $26.95 (Norton/Norton)

“King’s Counsel,” written in collaboration with veteran Washington Post journalist Vernon Loeb, has the obligatory spy vignettes, such as attempts to bug the Soviet embassy in Amman, but these are digressions from the main story about Hussein, war and peace. Other digressions include some questionable assertions based on hearsay: that Lyndon Johnson gave a green light to Israel to launch the 1967 war, that Henry Kissinger encouraged Egypt to launch the 1973 Yom Kippur War, and that the British government was happy to see Soviet spy Kim Philby abscond from Beirut to avoid the spectacle of a trial.

When O’Connell sticks to his first-hand experience in historic events in the Middle East — of which he had a lot — his book sheds important light on contentious issues that persist. He was heavily involved, for example, as an intermediary between the Jordanian king and senior U.S. officials in the negotiation of United Nations Security Council Resolution 242, the framework for what was supposed to have been Israel’s withdrawal from territories it occupied in the 1967 war. O’Connell’s account makes it clear that the United States promised Hussein that withdrawal meant a full pull-out subject only to “minor reciprocal border rectifications.”

Hussein renounced any Jordanian claim to the West Bank and signed a peace treaty with Israel in 1994. Israel continued colonizing the occupied territory, and the Palestinians were left without a state. “For the risks the king took in this search for peace,” O’Connell writes, “he was betrayed by both the Israelis and the Americans. It was a price he paid to find out that the Israelis preferred land to peace and that the Americans didn’t care which of the two the Israelis chose.” O’Connell adds that “in the king’s mind, no good would come” from this situation. The king was right.

Paul R. Pillar , a former national intelligence officer for the Near East and South Asia at the CIA, teaches at Georgetown University and is the author of the forthcoming “Intelligence and U.S. Foreign Policy.”