Ferdinand Marcos' flight into exile leaves a contradictory and dangerous legacy for his island nation and for the generation of U.S. policy makers who initially built him up as an Asian leader and ally but who finally turned away from Marcos when the price of supporting his erratic rule became too great.

The contradictory nature of the Marcos era was vividly captured in its final moments yesterday. As the former president fled his palace in Manila in fear of his life and openly repudiated by an angry civilian populace, Secretary of State George P. Shultz mounted a podium in Washington to praise Marcos as "a staunch friend of the United States" whose rule was "characterized by dignity and strength."

The conflicting judgments in Manila and in Washington seemed to be separated by 20 years as well as by half a world. Shultz seemed to be attempting to freeze in time the boyishly featured, tough and articulate young Marcos who lent vital political support to Lyndon Johnson in Vietnam in the late 1960s while launching an ambitious program of domestic reforms in Manila.

But for the Filipinos who besieged Marcos in the Malacanang Palace in the final hours of his rule, the image before their eyes was a still wily but enfeebled liar, cheat and likely accomplice to murder who ultimately brought himself down in disgrace rather than admit that anyone other than himself could run the Philippines.

It was to that image, rather than the nostalgic one Shultz offered at a press conference here, that the Reagan administration reluctantly yielded in the end as it yanked the rug out from under Marcos in a much more deft and decisive way than anything Jimmy Carter did to shah Mohammed Reza Pahlavi of Iran.

The Reagan White House succeeded in getting Marcos to hold back on using massive force against his opponents and to leave before bloodshed erupted. This was a significant difference with the Carter White House, where officials encouraged the shah to form a military government and to use the kind of force that resulted in splintering his army and stirring violent hatred of the United States for supporting him.

The heavy involvement of the Reagan administration in the transition to a new government headed by Corazon Aquino and military leaders who revolted against Marcos last weekend will suggest to many Filipinos that they can count on an even more active U.S. role in helping their nation confront the enormous problems that the 68-year-old Marcos left beneath him as he lifted off in a helicopter from the grounds of Malacanang Palace last night, Manila time.

Marcos left a shattered economy that was bled by his family and friends, a growing Communist-led insurgency that is filling a vacuum left by the absence of the government in the countryside, and a demoralized army where promotions have been given to those who support Marcos politically rather than for fighting the guerrillas of the New People's Army.

The success of the Aquino government in dealing with these problems will significantly affect American interests in the Pacific, just as Marcos' rise and disastrous decline became tightly entwined with the American role in the region.

Marcos' rise to power in 1965, when he won a hard-fought but relatively honest presidential campaign, was based solidly on his reputation as a skillful lawyer, legislator and politician, and somewhat more shakily on his version of World War II exploits as a guerrilla fighting with American forces against the Japanese occupation forces.

He first had come to national prominence in the 1930s, when he was in his early twenties, for two very different events -- he had placed first in the national bar examination, and he had been convicted of murdering the man who had defeated his father, a small-time politician, in a parliamentary election.

Defending himself, Marcos got the verdict overturned. Although he had campaigned against Filipino involvement in the expanded American commitment to Indochina in the 1960s, Marcos agreed on taking office to send engineering and medical teams to support the American effort, and organized regional support for the policies of the Johnson and Nixon administrations.

In 1972, facing a constitutional prohibition against his reelection and growing signs of an impending American pullback from the region, Marcos declared martial law and suspended the constitution. He arrested a number of his political opponents including senator Benigno Aquino Jr., closed down newspapers and launched a forceful campaign against common criminals, street gangs and warlords in the countryside.

The campaign against crime and serious disorder was popular with the middle class, much of the powerful Roman Catholic Church hierarchy and the business community, which was beginning to experience prosperity as Marcos' expansion of national rail and road routes and other infrastructure took hold.

With the rest of Southeast Asia appearing to totter in the final traumatic days of Vietnam, American policy makers seemed happy to have Marcos exert a firm grip over a nation that hosted the two largest U.S. military facilities abroad, Clark Air Base and Subic naval station.

In the late 1970s, even Marcos' critics among Filipinos described his style of autocratic rule as a very soft form of dictatorship, if they used that word at all. A popular saying described him as preferring to cajole an opponent before trying to buy him, preferring to intimidate before attempting to kill.

In an interview a few days before he formally lifted martial law in January 1981, Marcos gave the impression of a man who would rather outmaneuver his opponents than overpower or obliterate them. Feeling he had plenty of room to maneuver, he was gradually loosening up on the tight controls on the press and local politics that he had established nearly a decade before.

Beneath this, however, a gradual rot was setting into the economy, where Marcos and his forceful wife, Imelda, who increasingly took on government missions, were handing out monopolies in the country's vital export crops of sugar and coconuts to their cronies, and in the Army, which Marcos set out to pack with loyalists.

The atmosphere changed dramatically in the summer of 1983, when Marcos fell seriously ill and was apparently believed by his wife and her closest associates to be close to death. The illness, which was kept secret at the time, was believed to be caused by lupus erythematosus, an incurable, recurring disease that, in Marcos' case, seriously affects his kidneys.

Benigno Aquino, who had been freed and allowed to come to the United States under pressure from the Carter administration, chose that moment to return to Manila to challenge Marcos politically, apparently unaware of the grave state of Marcos' health and the panic it was causing in those around him.

On Aug. 21, 1983, Benigno Aquino arrived at Manila airport and was taken off the plane by armed soldiers under the command of Gen. Fabian Ver, Marcos' cousin and chief of staff, and murdered.

That murder led almost directly to the unraveling of the Marcos presidency that reached an end yesterday. Marcos quickly trapped himself, in the eyes of key U.S. policy makers, in ridiculous cover stories about his illness and about the murder.

When the then U.S. ambassador to the Philippines, Michael H. Armacost, sought to contact Marcos, he was put off for several days before Marcos called him back. The Filipino leader then sought to persuade Armacost that he was not ill but was working on a book. And he repeated the flimsy government cover story that Aquino had been killed by a Communist gunman who had conveniently been released from a presidential detention order just before the crime and was gunned down by Ver's troops as soon as Aquino was dead.

Armacost concluded that the United States could no longer rely on Marcos to tell the truth even on fundamental matters, according to diplomatic sources familiar with the exchanges, and appeared to come to believe that Marcos was, at a minimum, covering up for Ver.

That experience was to become crucial when Shultz named Armacost undersecretary of state for political affairs, the third-ranking job in the State Department, in 1984. Armacost and the regional specialists at State guided a successful effort to distance the Reagan administration from Marcos.

They apparently encountered no significant opposition in the White House. Unlike the Carter White House, where national security adviser Zbigniew Brzezinski stressed a globalist view of the Iranian problem, the more decentralized Reagan foreign policy machinery functioned relatively smoothly and was able to contain Reagan's own strong instincts to stay with a friendly ruler rather than gamble on the unknown.

In the end, there was almost nothing to stay with, as Marcos' health continued to be weak and he seemed to lose touch with reality at key moments.

The devastated economy will be one of the bitterest parts of his legacy for Filipinos, who have watched while most of the rest of Asia enjoyed economic prosperity and their economy has stagnated, losing 14 percent off gross national product in the past two years.

A collapsing economy was accompanied by cutbacks in military spending and a refusal by Marcos to admit that the guerrillas were growing stronger in the countryside. And at the same time the Soviet Union adopted a much more activist policy toward Asia, stepping up use of Cam Ranh Bay in Vietanm as a naval facility, gaining overflight rights over North Korea and targeting increasing numbers of SS20 missiles on China and Japan.

These developments led to alarm within an American military establishment that could normally have been counted on to support Marcos, and ultimately contributed to the dramatic scene in Manila yesterday of Marcos closing the book on his 20 years in power.