A federal jury convicted Edwin P. Wilson yesterday on seven of eight counts accusing the secretive ex-CIA agent of masterminding a 1979 scheme to smuggle handguns and a M16 rifle to Libyan officials as part of his $20 million private dealings with the radical Arab nation.

The jury in Alexandria acquitted Wilson on an interstate gun charge involving the transportation of four handguns from Fayetteville, N.C., to Wilson's estate in Virginia's hunt country by a former Wilson employe.

The 54-year-old Wilson, who faces up to 39 years in prison and a $240,000 fine in the case, stood with his hands clasped behind his back as a court clerk read the noontime verdict.

District Judge Richard L. Williams set sentencing for Dec. 17.

For Wilson, who appeared wan and gaunt after five months in federal custody, the verdict marked the end of the first of four trials related to his business empire's alleged Libyan dealings. He is scheduled for trial Nov. 29 in Houston and faces other charges, including murder conspiracy, in the District in January.

The Virginia jury, which deliberated for 4 1/2 hours over two days, heard only three defense witnesses before rejecting Wilson's argument that his overseas arms dealings were a cover for intelligence-gathering for the CIA. The government denied Wilson still had ties to the agency and said information forwarded by Wilson in 1981, after the first of his indictments, was worthless.

Chief defense lawyer Herald Price Fahringer said yesterday the verdict will be appealed. Fahringer said Williams refused a defense request that he tell the jury it could acquit Wilson if it believed he was working for the CIA. That issue, said the lawyer, "dominates the case."

A smiling Theodore S. Greenberg, the case's chief prosecutor, disagreed. "The CIA was not on trial because Wilson wasn't working for the CIA," Greenberg said. The message of the verdict, he said, is that "everyone has to follow the law, no matter who he works for."

In his closing argument on Tuesday, Greenberg told the seven-woman, five-man jury that Wilson's CIA claims were "a fanciful red herring to throw you off the track." Fahringer contended the Wilson case should be entitled: "The Spy Who Was Left Out in the Cold."

Both sides had subpoenaed past or present CIA officials to testify on whether Wilson was a lapsed spy at the time of the offenses, but neither called the witnesses to the stand to elaborate on any sanction Wilson's activities might have had.

Fahringer said yesterday he had no comment on the decision. Greenberg said CIA rebuttal witnesses were unnecessary because there was "absolutely no reason" to counter the defense argument. Wilson did not take the stand during the 2 1/2-day trial.

A former Wilson employe, Peter R. Goulding, said under defense questioning that he once believed Wilson's extensive European arms dealings were CIA-related. But on cross-examination, Goulding said he later changed his opinion after reading that Wilson was under investigation.

And in a damaging blow to the defense, Goulding related a May 1980 meeting in Geneva at which he said he confronted Wilson "to get some answers" and Wilson "said he'd kill my wife" if he returned to the United States and cooperated with investigators.

Defense lawyers sought to use Roberta Barnes, Wilson's girlfriend and former London office manager, in an effort to show a link between Wilson and the CIA. Barnes (code name "Wonder Woman," she said) testified she and another employe had delivered a list of Russian military equipment to Wilson in 1978 that she said came from Thomas Clines, then a senior CIA official. The document was not introduced as evidence and Barnes said under questioning that she didn't know if Wilson ever delivered any such equipment to the agency.

Barnes also said she helped Wilson in 1981 in an attempt to deliver to the CIA what the ex-spy said were plans for a nuclear reactor and an atomic weapon to be built in Libya. She acknowledged on government cross-examination, however, that Wilson then wanted U.S. charges against him dropped or reduced.

Assistant U.S. Attorney William C. Hendricks III said the documents were "deemed absolutely worthless" by CIA analysts.

Wilson was charged specifically with directing employes in the United States to procure four handguns and the M16 rifle as samples to show the Libyan government he could deliver on arms contracts.

One of the guns -- a Smith & Wesson .357 magnum -- later was used in the May 1980 assassination of a dissident Libyan diplomat in Bonn, according to the prosecutors. Although the government produced the gun in the courtroom this week, the jury was not told of its use in the slaying.

According to prosecution testimony, the handguns were purchased in the Fort Bragg area by a Wilson employe, Wallace Lloyd Klink of Fauquier County. Wilson allegedly paid $10,000 to buy the M16 from a friend in Washington. The weapons were illegally ferried by air to Europe hidden in a toolbox and a footlocker, witnesses said.

The courier who accompanied the M16, Reginald Slocombe, testified Wilson met him in Amsterdam and that Wilson then rushed the rifle by chartered jet to Tripoli. Shortly afterward, the government said, Wilson received an $11.6 million contract to furnish 5,000 M16s to Libya.

The defense maintained that, despite the contract (and an $8 million down payment by the Libyans), no other M16s were delivered by Wilson. Fahringer argued strenuously that Wilson had no criminal intent in arranging the deal.

Prosecutors, however, described Wilson as "motivated by greed" and elicited testimony from Barnes that Wilson held contracts totaling about $24 million for arms, uniforms, services and maintenance personnel for helicopters and C130 transport planes at a Libyan terrorist training camp.