A major Spanish electronics corporation agreed yesterday to plead guilty in U.S. District Court here to illegal importation of high-technology, national-security equipment from U.S. companies and subsequent resale to Cuba and the Soviet Union.

The company, Piher Semiconductors SA of Barcelona, pleaded guilty to two counts of violating the Export Administration Act, agreed to pay a recommended $1 million fine and to cooperate in an investigation of the case by U.S. Attorney Joseph E. diGenova.

In a companion case, a 10-count indictment was returned against two of the company's former senior officials, who face as much as 60 years in prison and millions of dollars in fines if extradited here.

DiGenova called the exported materials -- equipment to be used in manufacturing integrated circuits and semiconductors -- "the meat and potatoes of high-tech memory systems and miniature circuitry, the life blood of high technology. They gave away the store."

According to documents filed in court, shipments of equipment worth more than $2 million occurred from 1979 through early 1982.

Because of the equipment's potentially sensitive nature, the Commerce Department does not allow its export to the Soviet Union, communist bloc nations and countries identified with state-supported terrorist activities. Piher had been required to sign statements swearing that the equipment would remain in its facilities in Spain.

A federal source said the high-caliber integrated circuit manufacturing systems sent to the Soviet Union could be used to produce equipment with possible military applications, such as those used in secure communications, underwater surveillance and remote sensing systems.

DiGenova called the case, which was handled by his office, the Justice and Commerce departments and the Customs Service, "one of the most significant in the area of U.S. high-technology transfer" violations.

David Geneson, a prosecutor in diGenova's office, said Jose Puig Alabern, Piher's former chief executive officer, and Francesco Sole y Planas, a former Piher projects manager, attempted to convince U.S. consular officials who went to the Barcelona plant that the equipment was actually there.

"First, they refused to let them into the plant. Then, they constructed dummy equipment to look like the machines that had been shipped to the Soviets," Geneson said.

After being allowed into Piher facilities, U.S. consulate personnel photographed the dummy equipment, which its American manufacturers later determined was not what had been sent to Piher.

Although his office has recommended a $1 million fine, diGenova said the amount could be increased when the plea agreement is reviewed by the court. The case has not yet been assigned to a judge.

DiGenova said Piher voluntarily subjected itself to the jurisdiction of the U.S. courts because it wants to continue doing business with U.S. companies.

He said Piher has been on the Commerce Department's "denial list" -- meaning that it cannot deal in U.S.-manufactured goods -- for 2 1/2 years while the investigation continued, and will remain on the list nine more months.