WASHINGTON (AP) _ Defense giant Raytheon Co. will be able to buy Hughes Aircraft Co. from General Motors under an antitrust agreement reached Thursday with the Justice Department.

Under the agreement, Raytheon must sell two defense electronics businesses and establish business ``firewalls'' to preserve competition for a new Army antitank missile.

The Justice Department's Antitrust Division announced the agreement after the stock market closed. The deal allows Raytheon, a defense electronics and missile firm based in Lexington, Mass., to buy GM's Hughes subsidiary, based in Arlington, Va., for $9.5 billion.

The key part of the settlement obligates Raytheon to sell off a Dallas-based infrared sensors business it recently bought from Texas Instruments and an electro-optical systems business with operations in El Segundo, Calif., and La Grange, Ga., that would have been part of the Hughes deal.

Raytheon must operate the two as separate entities until it finds buyers.

``The U.S. military needs weapons at prices American taxpayers can afford,'' said Joel Klein, assistant attorney general in charge of the antitrust division. ``Today's agreement demonstrates the division's absolute commitment to protect competition in the defense industry'' despite consolidation resulting from post-Cold War military force reductions.

``The combination of Raytheon and Hughes defense businesses will create a company with the resources required to compete in defense electronics with any company worldwide,'' Raytheon said in a statement.

Raytheon and General Motors agreed to the sale in January. Once completed, the merger will create a company of more than 120,000 employees with about $20 billion in sales, two-thirds of which are in defense electronics.

The Pentagon launched a major review of the proposed buyout last spring amid anxiety about increased concentration of defense companies. In particular, the Pentagon worried that the deal would make Raytheon the dominant producer of air-to-air missiles. That still is the case, but the Pentagon apparently determined that efficiencies resulting from combined air-to-air missile production by Raytheon and Hughes would lower costs.

The Justice Department said it will not file its proposed settlement in federal court until further negotiations between the two companies determine what benefits are passed on to the Pentagon through combining production of the AMRAAM medium-range air-to-air missiles.

Deputy Defense Secretary John Hamre conveyed to the Justice Department the Pentagon's approval of the settlement in a letter Thursday. He wrote that a shift to one AMRAAM supplier may have been inevitable because the Air Force had concluded ``it would not be economical to sustain two producers'' even before the Raytheon-GM deal was announced.

Raytheon and Hughes are the leading producers of infrared and electro-optical equipment, the Justice Department said. Sensors produced by the two firms are used, among other places, on M-1 Abrams tanks and M-2 Bradley Fighting Vehicles.

Provisions in the agreement announced Thursday are designed to preserve competition during the bidding for the Army's next version of the tube-launched, optically tracked, wire-guided antitank missile, or TOW. Two teams are bidding for the contract, expected to be awarded early next year, Hughes and a joint venture of Raytheon and Lockheed Martin.

Raytheon, which also builds guided missiles, space vehicle components, defense electronics and radar systems, had $13 billion in sales last year. Hughes, which has a similar product line, had sales last year of $6 billion.