American foreign policy has been buffeted for years between two conflicting tendencies - the ideological and the pragmatic.

The policy toward Pakistan, whose president, Mohammed Zia ul-Haq, died Wednesday in a plane crash along with U.S. Ambassador Arnold Raphel, was a clear example of pragmatism winning out over ideology.Bedeviling policymakers for years is this question: should the United States emphasize a commitment to democracy and human rights or should it focus instead on national security concerns?

The stress on pragmatism reached a peak during the era of President Nixon, who opened friendly relations with China during the unparalleled repression of the Cultural Revolution in that country.

Nixon, along with his chief foreign policy adviser, Henry A. Kissinger, were convinced that accommodation with China would be produce a geopolitical advantage for both countries in their struggle against the Soviet Union.

China's human rights abuses were viewed in Washington as an internal matter.

Pragmatic concerns also induced Nixon to promote close ties with leaders of other strategically important countries known for their heavy-handed rulers, such as the Shah of Iran.

Kissinger derided as "missionaries" his State Department colleagues who encouraged him to add a human rights dimension to U.S. policy. They, in turn, looked on Kissinger as a cynic.

Emphasis on moralistic concerns reached a peak during the Carter administration, which loosened ties with Latin-American military dictatorships with the argument that intimacy with such rulers was inconsistent with American values.

President Carter took a strong stand against Chile's military dictatorship, reversing the policy of friendship that Kissinger had established under Nixon.

Pakistan loomed relatively small on the horizon during the early Carter years but suddenly took on strategic importance when Soviet troops occupied Afghanistan in December 1979.

Carter, acting under a law aimed at preventing the spread of nuclear weapons, had cut off assistance to Pakistan eight months before the Soviet invasion because he had determined that Pakistan was developing a nuclear capability.

Carter restored the aid after the invasion.

President Reagan took office in 1981 determined to restore Zia's confidence in the United States, which had suffered a severe setback during the Carter years.

Zia's tough-line stance against Soviet intervention in Afghanistan so pleased the Reagan administration that it ignored other aspects of his rule that the United States normally finds distasteful.

Zia allowed U.S.-backed Afghan rebels to use Pakistan as a launching pad for attacks against his pro-Soviet neighbor. He also provided a safe haven for millions of Afghan refugees in Pakistan.

Reagan overlooked Zia's role as a military leader with a powerful distrust for multiparty democracy. Concerns that Pakistani territory was the source of U.S.-bound heroin were muted.

Zia's backers in Washington believed he not only performed a strategic service to the United States in Afghanistan but kept a rein on Islamic fundamentalists and separatist tendencies in his own country.

Rejecting congressional concerns about Pakistan's nuclear program, the administration made Pakistan the fourth largest U.S. aid recipient in the world, with a six-year commitment totaling $3.3 billion.