As Hamas leader Khaled Meshal drove up to his office here one morning late last month, two men were loitering outside the door. One was dark and muscular, the other bearded and blond. According to five witnesses, the blond fell in behind Meshal as he left his car and extended an arm to the Hamas leader's left ear. From a lead-colored instrument wrapped in tape came a loud popping sound, Meshal said, and a shivering sensation raced down his spine "like an electric shock."

Within minutes of the Sept. 25 attack, Meshal's bodyguard would run the men down and subdue them in a bloody fistfight a mile away. Within hours, Meshal, 41, would lie perilously close to death in a military hospital with uncontrollable vomiting and respiratory arrest. By the following day, U.S. and Jordanian officials said, the two captured assailants' cover identities as Canadian tourists had unraveled, and their Jordanian interrogators had recognized them as agents of Mossad, the Israeli espionage agency. The 10 days since what is described here and in Israel as a botched assassination attempt have been some of the costliest for Israel in the history of its storied security services.

Jordan's King Hussein, Israel's closest Arab ally, was so enraged by the attack in his capital that close confidants said today he came to the brink of breaking relations with the Jewish state. Canada, protesting the breach of previous promises to stop forging its passports, recalled its ambassador to Israel.

According to Israeli opposition leader Ehud Barak, Prime Minister Binyamin Netanyahu told him today that he himself had directed the effort to kill Meshal. Senior U.S. officials, who have participated in American efforts at damage control, confirmed that the orders came from the highest levels of Israel's government.

Yet after spraying what U.S. and Jordanian officials described as a lethal nerve toxin through the Hamas leader's skin, Israel was compelled to meet Jordanian and American demands to supply the antidote -- an extraordinary if indirect admission of Israeli sponsorship of an assassination attempt. The U.S. and Jordanian sources said that Mossad agents still in Jordan, participants in the operation who carried the antidote in case of accident, turned it over to Jordanian doctors the following day.

Meshal's revival from the gates of death -- U.S. officials said the poison, which they declined to name, would have killed him within 48 hours -- in some ways prefigured a resurrection of his Islamic Resistance Movement, or Hamas.

Hamas, a militant anti-Israeli group, had been on the defensive recently, its spokesman arrested in Jordan and its mosques and social service centers shut down in the West Bank and Gaza Strip amid the first serious crackdown on the organization by Palestinian leader Yasser Arafat since early 1996. But in Netanyahu's efforts to calm the crisis with Jordan -- he flew secretly to Amman last weekend, but Israeli and Jordanian officials said the king refused to see him -- the Israeli premier not only saved Meshal's life but freed the founder of Hamas, Sheik Ahmed Yassin, from a life term in an Israeli prison.

That marked the end, for now at least, of further pressure on Hamas by Arafat or Hussein. Both men, although threatened by Islamic fundamentalists, felt compelled by strong Islamic constituencies to hasten to Yassin's hospital bedside and cover the popular religious leader with kisses to the forehead and cheeks. According to Palestinian and American officials, weeks of systematic arrests of Hamas members by Arafat's Palestinian Authority have ground to a halt.

Jordan's Crown Prince Hassan, returning from an emergency trip to see President Clinton in Washington, said in an interview at his palace guest house today that he feels "waves of nausea still" when he thinks of Israel's betrayal and its consequences.

"I think it is an act of gross stupidity," he said. "We are always reminded that Israel is the only democratic state in the region . . . and yet you find the only democratic state in the region being associated with an act of terror. What is the point of our meeting in Sharm al-Sheik {in 1996} condemning terror in all its aspects?"

In public, the Israeli government is saying little about the debacle. Cabinet Secretary Dani Naveh read a brief statement today announcing that "the government of Israel refrains at this time from commenting on media reports regarding activities against Hamas leader Khaled Meshal."

The statement went on to describe Meshal as "the preeminent figure in Hamas and responsible for the murder of innocent Israeli civilians." It added, "The government's responsibility is to protect the lives of its citizens and to fight uncompromisingly against terrorism."

Opposition leader Barak, a former armed services chief of staff who met one-on-one with Netanyahu today, described the private meeting for Israeli Television shortly afterward. "The prime minister has taken responsibility," he said. "He said he approved it, and he's responsible."

"It was a pathetic decision and would never have been made by any other prime minister since {the late Menachem} Begin," Barak added.

His remarks contributed to a bitter political debate that has featured finger-pointing among Israeli security services and calls for the resignations of Netanyahu and Mossad chief Dani Yatom.

The attempt on Meshal's life had its origin, according to Israeli officials, in an emergency cabinet meeting July 30. Two Hamas suicide bombers, in synchronized explosions, killed 16 Israelis that day in the Mahane Yehuda produce market in Jerusalem. The cabinet, according to two of its members, voted a broadly worded authorization to hunt down Hamas military leaders wherever they could be found. It did not approve specific targets or set constraints.

Late in September, two Israeli agents checked into Amman's Intercontinental Hotel, posing as Canadian tourists. According to documents transliterated into Arabic and then back to English, their passports identified them as Shawn Kendall, 28, and Barry Beads, 36.

On the morning of Sept. 25, Meshal's driver grew suspicious when an olive-green Hyundai sedan appeared to be following their car. Just before they reached the office in a new commercial district of southern Amman, the green car passed them and drove out of sight.

The driver, who asked that he not be named, said he spotted the two foreigners loitering as he pulled up in front of Meshal's office. He told Meshal to circle the rear of the car and meet him at the driver's door, and he placed himself between Meshal and the suspicious men.

Raghda Mohammed, who works in the adjacent infant products store, said the blond foreigner had some kind of device strapped to his right arm with white tape. "He reached toward {Meshal's} neck, and I heard a bang," she said.

Meshal's driver, poised for trouble, thrust upward on the blond man's arm and knocked him to the ground. The man's glasses tumbled to the pavement, and the driver snatched them up. According to three witnesses, the two foreigners then fled on foot.

Mohammed Abu Saif, 30, Meshal's bodyguard, was just arriving in a trail car. A powerfully built man with martial arts training, he saw the scuffle and sprinted after the fleeing Israelis. The muscular one, who was slower, turned and threw a soda can at his pursuer but missed.

Rounding a corner after 200 yards, the Israelis jumped into an olive green Hyundai rental car bearing license number 5374. "The car was already moving," Abu Saif said in an interview. "It looked as if they had trained to do that."

Abu Saif stood in the center of the street and waved down an oncoming private car. The driver accelerated after the Hyundai, which rounded two curves at high speed and then unexpectedly stopped to let the Israelis off after less than a mile.

Jordanian officials speculated that the Israeli escape plan called for a switch to another car. When he emerged from the Hyundai, the blond man no longer had the instrument strapped to his arm, and the weapon used against Meshal has not been recovered.

Abu Saif, whose account was backed in several details by witnesses who gathered to watch the fight, said he caught the muscular dark man by the back of his shirt. The blond man pivoted and slammed a hard object into Abu Saif's head, leaving him with a wound that took 18 stitches and eight days in a hospital to repair.

"I got the heavily built guy and hit him with a right in the face and dropped him on the ground," Abu Saif said. "The second guy attacked me, and I hit him in the face. Then the muscular guy got up with a stone in his hand, but I was able to hold his friend, and I used him as a shield."

The bodyguard then threw the blond man down an embankment and tumbled after him. The muscular Israeli, he said, could have escaped but did not. By this time, from the gathering crowd, a man emerged and said he was a security officer.

Together, the two Jordanians bundled the battered Israelis into a taxi and took them to the police station at Wadi Seir. When a Canadian consular officer arrived some time later, his ostensible countrymen refused offers to provide a lawyer, a doctor or information to their families in Canada.

Meshal, meanwhile, soon found he could not stand upright.

"Two hours after the attack, he started with acute vertigo and severe vomiting, and he was taken to Islamic Hospital," said Ishak Maraqa, a neurosurgeon and friend of Meshal's who visited his bedside. "While there, he started to have difficulty breathing. On his majesty's orders, he was moved to King Hussein Medical Center, and there his respiration failed."

By the following morning, a Friday, said fellow Hamas politburo member Mousa Abu Marzook, Meshal had a fever of 102 degrees that did not respond to treatment.

"He was unconscious and breathing on a respirator, and there was no hope," Abu Marzook said. "The doctors analyzed everything, and they couldn't find what was the problem."

Jordanian intelligence by this time knew or surmised that Meshal had been felled by some sort of chemical attack. In the first frantic flurry of phone calls -- there were dozens, officials said, at every level of both governments -- Hussein drew a line. If Meshal died, he told Netanyahu, according to a briefing given to the semiofficial newspaper al-Rai, Israel's agents would be tried in public and hanged, and anything could happen in relations between the two states. "If the case was not treated and death was the result of this attack," Prime Minister Abdel Salam Majali said in an interview today, "certainly things would have developed in a very nasty way." By the end of the day on Friday, the antidote was handed over, apparently on orders from Netanyahu.

On Saturday, according to officials from both governments, Hussein telephoned President Clinton to plead for further help in treating the poison and managing the crisis. By Sunday, a top-ranking delegation of Israelis was in Amman, including Netanyahu, Defense Minister Yitzhak Mordechai, Infrastructure Minister Ariel Sharon, Naveh and security officials David Ivri and Efraim Halevy.

Israel wanted its agents back. Hussein, refusing to meet Netanyahu, told them through Crown Prince Hassan that his price would begin with Yassin's release -- to placate Jordan's Islamic opposition. Hussein, who regards the participation of Islamic militants in parliament as essential to Jordan's stability, already was fighting a losing battle to reverse their boycott of legislative elections set for Nov. 4.

Hassan flew Monday to Washington with a briefcase full of evidence implicating Israel. There, he briefed Clinton, Vice President Gore and Secretary of State Madeleine K. Albright, pleading for help to turn Arab-Israeli relations from what the king regards as their present disastrous course. CAPTION: A BUNGLED ISRAELI ATTACK IN SOUTHERN SUBURB OF AMMAN 1. Two Israeli agents attack Meshal in front of his office. 2. The Israelis flee on foot, pursued by Hamas bodyguard Mohammed Abu Saif. 3. The Israelis jump into a waiting Hyundai and speed off. Abu Saif flags down a passing car and pursues them. 4. The Israelis get out of the car, which speeds away, and cross a vacant lot toward Medina Monawara Street. Abu Saif pursues them on foot. 5. The Israelis notice Abu Saif and run across street, then cross again. 6. Abu Saif catches Israelis and fights them until a crowd arrives, and a man in it helps him subdue the Israelis. The two Jordanians force the Israelis into a taxi and take them to police.