House and Senate negotiators agreed last night on a $298.7 billion defense-spending package for the current fiscal year that would ban testing of antisatellite weapons, a key element of President Reagan's space defense system.

Antinuclear forces hailed the agreement as a major victory. "It's an absolute triumph," said Rep. Les AuCoin (D-Ore.) after a lengthy meeting in which the defense package was decided. "We did more for arms control in five hours than has been done in the last five years."

Sen. Ted Stevens (R-Alaska) said that Republicans were forced to agree to the ban on testing antisatellite, or ASAT, weapons despite a last-minute telephoned appeal from the president.

The Defense Department conducted its first test of an ASAT weapon in October, and at least two more tests are planned soon. Reagan has said that continued testing was necessary in order to strengthen the U.S. hand in arms-control talks with the Soviet Union.

At the same time, the committee agreed to trim nearly $1 billion from Reagan's $3.7 billion request for research and development of his space-based missile defense proposal, the Strategic Defense Initiative. The $2.75 billion appropriation for "Star Wars" technology, however, was nearly double the $1.4 billion appropriated in fiscal 1985.

In addition, the committee agreed to permit resumption of chemical weapons production next October, while it eliminated all funds for the House's procurement reform measures.

The agreement, negotiated over the past three days by a panel on defense, is expected to be ratified by the conference committee next week and will govern Pentagon spending for the remainder of fiscal 1986, which ends Sept. 30. The defense measure is part of an omnibus spending bill that Congress hopes to finish early next week.

Overall, the Pentagon spending figure was near the midpoint between the House and Senate bills. The Democratic-controlled House had approved an appropriation of $292 billion, the same as last year's, while the Republican-led Senate had sought to raise it to $302 billion, allowing an increase for inflation.