The United States and Pakistan announced major progress yesterday toward resuming a close economic and security relationship on the basis of a five-year program of American aid.

Statements by Secretary of State Alexander M. Haig Jr. and Pakistrani Foreign Minister Agha Shahi, following a day and a half of intensive talks, fell short of announcing a final agreement or of spelling out details of future ties envisioned by the two countries.

Neither Haig nor Shahi would specify the sums being considered in current discussions, although informed sources said the aid could amount to as much as $500 million per year, including economic assistance and arms sales credits. No final figures have been agreed upon, the sources said. a

Both officials said the talks had brought movement toward improved relations. The Pakistani minister's public posture toward Washington's offers was much more positive than in the recent past when Pakistan rejected as "peanuts" the Carter administration's bid for renewed ties with a $400 million, two-year program.

The new U.S.-Pakistan relationship, which may be finalized at a further round of talks expected in the next several months, will be far less than the full-scale military alliance of the two countries in the early years after World War II.

But it will be much closer than the off-again, on-again relationship of uncertainty and estrangement of the last several years.

Shahi, explaining the shift in Pakistani views, said: "The previous Carter administration offer did not carry for us credibility in a U.S.-Pakistan relationship commensurate . . . [with] what we considered to be the magnitude of the threat."

Shahi appeared to be referring to the pressure of Soviet military forces across a long and porous border in Afghanistan.

He added: "The Reagan administration has put forward a five-year plan. That is the difference."

The Pakistanis have asked that high-performance U.S. aircraft and other military items be provided on subsidized credit terms similar to those furnished to India by the Soviet Union.

Not permanent presence of U.S. military forces in Pakistan is envisaged, however, nor is Pakistan expected to participate in any regional security arrangement with the United States.

There is no sign that Pakistan is prepared to take on a role as conduit for increased U.S. and Western military aid to rebel forces fighting in Afghanistan. The Pakistanis have argued that such involvement on their part in the Afgan struggle would court reprisals from the Soviet Union, which has repeatedly warned Islamabad directly and through third parties.

Pakistani officials left the impression here that they would have to be far more confident of their ability to resist a Soviet threat for them to take a large-scale role as a weapons conduit to the Afghan insurgents.

Any U.S. aid to Pakistan requires congressional action to amend U.S. laws against proliferation of nuclear weapons. In April, 1979, the Carter administration, acting under provisions of those laws, cut off economic and military assistance because of evidence that Pakistan is seeking to build an atomic bomb.

The nuclear weapons drive is believed to be continuing, especially in a large, highly secret uranium enrichment plant near Islamabad, and U.S. diplomats continue to be active throughout the world to frustrate Pakistan's drive to import materials and technology for its bomb works.

U.S. priorities changed drastically following the Soviet invasion of Afghanistan in December, 1979, but the government of President Mohammed Zia ul-Huq rejected the Carter program for a quick shift from cool relations to an embrace.

The Reagan adminstration has asked Congress to amend anti-proliferation laws to make possible aid to Pakistan if the president certifies that a continuing cutoff would "jeopardize the common defense and security."

A House Foreign Affairs subcommittee voted unanimously earlier this month to defer action on this request until lawmakers can obtain information about overall dimensions and repercussions of a Pakistani aid program.

Pakistan's nuclear weapons program, not even mentioned by President Carter in his final meeting with Zia last October, played a relatively small part in this week's discussions, according to U.S. sources.

The Reagan administration continued to express concern about potential nuclear weapons proliferation but did not seek new assurances from Pakistan as a condition of restoring aid.

Pakistan has dropped its demand for new U.S. security assurances as part of a restored relationship.Pakistani officials apparently have become convinced that any security guarantees short of a formal and tightly binding treaty would be of dubious significance in a moment of challenge.

The chances of obtaining a binding U.S. security treaty are small, and it is clear that Pakistan currently does not wish to jeopardize its nonaligned and Islamic credentials by forging an intimate and open security alliance with the United States.