A senior Pakistani official said yesterday his country was not interested in an American offer of $400 million in military and economic assistance but it was unclear whether Pakistan was formally rejecting it.

In a speech before municipal leaders in Islamabad, Agha Shahi, foreign affairs adviser to President Mohammed Zia ul-Haq, said it would not be "prudent" for Pakistan "to be dependent for our security on any single power."

The acceptance of U.S. aid, he added, would threaten Pakistan's nonaligned status and its links to the Islamic world.

The $400 million in economic and military aid during the next two years was offered by the Carter administration following the Soviet invasion of Afghanistan. Pakistan has a 1,200-mile border with Afghanistan and has offered refuge to an estimated 500,000 Afghans fleeing their country in recent months.

It was unclear whether Shahi's statements were designed merely for domestic consumption or whether they reflect a definitive government shift on the issue.

Pakistan's Ambassador Sultan Muhammad Khan, who called on Assistant Secretary of State Harold Saunders yesterday, said that "reports are still being prepared on this program and the process of discussions is not over."

State Department officials said they have not been notified of any change in the Pakistani position in recent days. They acknowledge that there were difficulties with the aid proposal.

Shahi was quoted by news agencies as saying that "Pakistan has specifically disassociated itself from any U.S. initiative to introduce the relevant legislation in the American Congress.

"It is our considered view that for its security, Pakistan must depend primarily on its national unity and strength, as well as [on] the time-tested friendship of China. It will not be prudent on our part to be dependent for our security on any single power."

Zia, who asked for Western aid following the Soviet invasion of Afghanistan, had termed the proposed U.S. package as "peanuts."

Shahi was quoted as saying yesterday that Zia had told Zbigniew Brzezinski President Carter's national security adviser, who visited Islamabad in early February, that "the acceptance of the U.S. offer of aid, unless substantially modified, will have detracted from rather than enhanced our security."

The Soviets have accused Pakistan of serving as a conduit for U.S. and Chinese aid to Afghan rebels fighting the Marxist government in Kabul.

The Karachi newspaper Jang yesterday quoted Zia as saying that international groups should visit Afghan refugee areas to verify his claim that the rebels are not being trained in Pakistan. Zia was also quoted as saying he would accept the stationing of international troops "both inside and along the borders of Afghanistan to guarantee against any interference from the Pakistan side."

Meanwhile, wire services reported a continued flow of Afghan refugees into Pakistan following the four-day-old Soviet offensive in the eastern Kunar province.

There were also allegations that the Soviets were using "poison gas" against rebel strongholds in the province. The State Department expressed concern over these reports which officials said seem credible although they could not be verified conclusively.

"If these reports are true," department spokesman Hodding Carter said, "we would regard such use as an outrageous and inhuman act." He added that the United States has raised the issue with the U.N. Commission on Human Rights.

In an interview with the Bombay weekly Blitz, Afghanistan's President Babrak Karmal said he would welcome the establishment of an international border force to police his country's frontier with Pakistan. He said a "credible guarantee" from Pakistan that its territory would not be used for "subversive purposes" was needed before he would ask Moscow to withdraw its troops.