House and Senate negotiators agreed yesterday on a new foreign aid bill that enables President Bush to forgive Egypt's $6.7 billion military debt, but sharply cuts U.S. aid to El Salvador in line with earlier votes in Congress.

The Egyptian initiative was the administration's top priority in the $15 billion bill. Nevertheless, it was unclear whether its inclusion would forestall a presidential veto over the Salvadoran aid cut. House Republican conferees withheld support for the Salvadoran provisions.

"My guess is that {the president} would consider that this is the best he would get," said Rep. Mickey Edwards (R-Okla.), chief Republican House negotiator. But he said there was no guarantee that the measure would be signed. State Department officials who attended the negotiations, he said, were "not taking it as a 'you-win-some-and-lose-some' kind of thing."

A spokesman for the chief Senate negotiator, Patrick J. Leahy (D-Vt.), said, "Leahy won't back down on this. He's worked for 10 years to get here." Efforts to obtain a comment from the White House were unsuccessful.

The Egyptian debt initiative has been supported in the Senate, but until yesterday the House had refused to go along because of strong negative reaction from constituents.

The compromise reached at dawn yesterday after a stormy all-night bargaining session, appears to achieve the administration's objective while also providing some cover for House members who do not want to face voters Nov. 6 after supporting massive debt forgiveness abroad as the United States enters a recession.

Egypt will not have to make further payments on the debt, which were incurred between 1979 and 1984 buying U.S. military equipment on credit.

However, the debt will not be forgiven until the president has followed a series of procedures, ending with a report to Congress certifying that forgiveness is in the U.S. national interest.

In accordance with earlier votes in the House and Senate, the negotiators withheld half of El Salvador's $85 million military aid for 1991 unless the Farabundo Marti National Liberation Front refuses to negotiate a peace settlement. If the government breaks off peace talks it would lose all the aid. The purpose is to apply pressure on both sides to keep talking, but the Bush administration has strongly opposed the restrictions.

As a face-saving concession to the administration, the conferees exempted from the restrictions some $20 million of previous military aid now in the pipeline.

During a session in which Democrats shouted angrily at each other as much as at Republicans, military grants or credits were earmarked to Israel, Turkey, Greece, Morocco and Portugal. In a shift reflecting Persian Gulf tensions, conferees dropped a House-approved military earmark of $50 million for Jordan, but maintained economic assistance. Neither house earmarked funds for Pakistan.

The East European economic aid package was set at $369 million, but a House-Senate dispute on aid to the Baltic republics could not be settled and will be resolved when conferees send their report to the floor. Up to $20 million was allowed for Cambodia.

As the conferees continued to bargain behind the scenes over these foreign aid issues, Congress completed work on the two main 1991 defense bills in a spirit of surprising harmony.

By back-to-back votes of 80 to 17, the Senate cleared the final conference reports on both measures and dispatched them to the president.

Nonetheless, Senate debate on the $268 billion appropriations bill brought out uneasiness over a provision that extends to 360 days from 180 days the time that the president can call up combat reserves or National Guard units without declaring an emergency.

Sen. Albert Gore Jr. (D-Tenn.) said the "enhancement" of presidential authority on the eve of congressional adjournment was a "further derogation of Congress's authority."

"I hate to see us just sort of sneaking around the current law," said Sen. John Glenn (D-Ohio). Glenn said the present call-up authority is designed to be limited. The president has separate authority to call up one million reserves for a year in a declared emergency.

However, key House members have argued that the 180-day period is too short to provide training for combat units.