Secretary of State Madeleine K. Albright had just emerged from a bruising session with Russian intellectuals who were viscerally opposed to NATO expansion.

Their message was stark: The Clinton administration plan to extend U.S. security guarantees to the border of the former Soviet Union would lead to a new East-West division of Europe.

"Your intellectuals have been berating me for the past hour," Albright told Russian Foreign Minister Yevgeny Primakov when she met with him May 2 for what turned out to be a crucial meeting in the long negotiations to hammer out a new relationship between NATO and Russia. "To use a phrase often used by President Clinton, I feel your pain.' "

Albright's quip got a laugh from the usually dour Primakov, according to U.S. officials who accompanied her on her trip to Moscow earlier this month. In some ways, the incident also captured the flavor of a diplomatic roller-coaster ride that preceded today's signing ceremony in Paris of a NATO-Russia charter that clears the way for the 16-member NATO to ask Poland, the Czech Republic and Hungary to join the alliance by 1999.

NATO expansion was always going to be a painful experience for Russian leaders, but they evidently concluded that they had no alternative than to grin and bear it.

For their part, Clinton administration officials see today's agreement between NATO and Russia as a vindication of their decision to stick with President Boris Yeltsin through good times and bad. They argue that the negotiating record of the past 2 1/2 years -- going back to September 1994, when Clinton first broached the idea of NATO expansion to a suspicious Yeltsin -- supports their view that the "Boris-Bill" connection was crucial.

"Yeltsin was the key to everything," said a Clinton foreign policy aide. "At critical moments, it was Yeltsin who provided the decisive leadership by giving indisputable signs of where he wanted to go."

The U.S. investment in Yeltsin has been reflected in the time Clinton has spent nurturing the relationship and the sensitivity American officials have displayed to his domestic political needs. On one occasion, according to an eyewitness account, they effectively covered up for him when he had too much to drink.

Clinton became president by promising to "focus like a laser beam" on the domestic economy. But he made an exception for Russia, a country that had excited his interest ever since he visited Moscow as a Rhodes scholar in 1970.

Clinton "felt that what happened in Russia would be a key element of his foreign policy legacy," said former political consultant Dick Morris. "When {he} took office, he thought there was only one important state -- California -- and one important country -- Russia."

For much of 1993, a debate raged within the administration over whether to expand NATO to include former Soviet satellites in Eastern Europe. Countries such as Poland and Hungary were clamoring to join the U.S.-led alliance, which they saw as their ticket to the Western club of affluent, democratic nations. In Russia, by contrast, NATO was still seen as the old Cold War enemy.

Russia experts in the administration joined forces with the Pentagon in opposing calls for rapid NATO enlargement, for fear of antagonizing Moscow. In the end, however, the bureaucracy coalesced around a more gradual approach that also provided for a parallel NATO-Russia track designed to address Russian concerns about being left out in the cold.

When Yeltsin came to Washington in September 1994, Clinton tried to convince him that NATO expansion was a good idea. He promised Yeltsin that the process would be open and transparent, and that there would be no surprises. Despite misgivings of some of America's European allies, he also held out the prospect of Russia's being admitted to NATO eventually.

Three months after the Washington meeting, Yeltsin shocked the Clinton administration by reneging on an apparent agreement to let Russia join a military cooperation program known as Partnership for Peace. At an international conference in Budapest, the Russian leader blasted the very notion of NATO expansion, arguing that there was a risk of transforming the Cold War into a "cold peace."

To repair the damage, Clinton accepted an invitation from Yeltsin to attend celebrations in Moscow in May 1995 to mark the 50th anniversary of the Allied victory over Nazi Germany. The Russian leader had just sent troops into the breakaway province of Chechnya and there was some opposition to the visit in the United States. White House officials fretted about photographs of Clinton paying tribute to an army tarnished by terrible atrocities.

But the decision to massage Yeltsin's political ego paid dividends. The Russian leader dropped his opposition to Russian participation in the Partnership for Peace and signaled that he was ready for discussions with NATO. Clinton aides look back to the May 1995 Moscow meeting as one of several occasions in which the "Bill-Boris relationship" was decisive.

Another such occasion occurred four months later, when Clinton invited Yeltsin to meet him at Hyde Park, N.Y., the birthplace of President Franklin D. Roosevelt.

The evocation of the wartime U.S.-Russia alliance appealed to Yeltsin. He presented Clinton with a pair of hockey jerseys labeled "Yeltsin 96" and "Clinton 96." During a long one-on-one session, he agreed that Russia would participate in a NATO peacekeeping force for Bosnia.

The Hyde Park summit was memorable for another reason. According to several people present, Yeltsin got drunk, downing glass after glass of white wine at a luncheon in his honor. At a news conference, he chided the news media for predicting that the meeting might end up as a "disaster."

"Now, for the first time, I can tell you that you are a disaster," he told journalists, as he and Clinton doubled up in laughter.

Two days later, he suffered a heart attack.

Over the next year, U.S.-Russia relations were effectively put on hold as Yeltsin recovered from various illnesses and campaigned for reelection as president of Russia in July 1996. Shortly before the election, he had another heart attack. On Nov. 5, he underwent quintuple bypass surgery.

According to the White House, Clinton wrote to Yeltsin at the end of that month, following his own reelection as president. The letter stressed the need "to get together soon" and move forward on negotiating an agreement on future cooperation between Russia and NATO. A week later, the two presidents spoke on the phone and agreed to a meeting in early 1997.

The final stage of negotiations with Moscow began with the Russians making a strong pitch to prevent NATO from moving any military infrastructure eastward and agreeing to a de facto ban on former Soviet republics joining NATO. But Primakov received a tart response from Albright when he came to Washington in March, to pave the way for a Clinton-Yeltsin summit in Helsinki.

According to an aide, the Czech-born secretary told the Russian foreign minister that she had no intention of negotiating away the rights of Central and East European countries. "Neither history nor morality will permit it."

When Yeltsin met with Clinton in Helsinki a few days later, he tried a similar tack, suggesting a gentlemen's "understanding" barring the Baltic states of Lithuania, Latvia and Estonia from NATO membership. Clinton replied that such an understanding would be against Russia's "own interests."

"If you try to impose restrictions on who gets into NATO, you will impose a restriction on whether you yourselves get into NATO," he said.

U.S. officials came away from the Helsinki summit with the strong impression that Yeltsin had decided to make a deal. Although Russia would not drop its objections to NATO expansion, it would seek a political accommodation with the United States. In return for assurances that an expanded NATO posed no military threat to Russia, Yeltsin would sign a document agreeing to cooperate with the alliance. The military chiefs had begun working on Primakov during his visit to Washington in mid-March. They invited him to the war room of the Pentagon and gave him a two-hour briefing on NATO's military capabilities.

U.S. generals used slides and other audiovisual aids to convince the former head of Russian intelligence that NATO troop levels were way down from the days of the Cold War.

Primakov, however, wanted more concrete guarantees that there would be no eastward movement in NATO's military infrastructure. Among other things, the Kremlin wanted Washington to agree to a "sufficiency" rule, setting a maximum limit on NATO holdings of certain military equipment.

Although Yeltsin and Clinton had agreed in principle to sign the NATO-Russia agreement in Paris on May 27, there was still no deal when Albright went to Moscow at the beginning of May. The first day of meetings produced little movement. Albright was on the point of returning to Washington empty-handed when Primakov offered a new Russian proposal, dropping the "sufficiency" rule. In return, Albright hinted that the alliance was ready to make a statement ruling out the use of old Warsaw Pact nuclear storage sites by NATO.

NATO Secretary General Javier Solana traveled to Moscow two weeks later, to wrap up the remaining details. While Solana was negotiating with Primakov, the Russian foreign minister received two telephone calls from Yeltsin -- after which, according to a Solana aide, there was a softening in the Russian position. Primakov's insistence on cast-iron guarantees ruling out any eastward movement in NATO's military infrastructure melted away.