Edwin P. Wilson, a shadowy former CIA operative and arms dealer who served more than two decades in prison before a federal judge overturned his conviction for selling explosives to Libya, died Sept. 10 in Seattle. He was 84.

He had complications from heart-valve replacement surgery, Craig Emmick, a director at Columbia Funeral Home in Seattle, told the Associated Press.

A former Marine who stood 6-foot-4, Mr. Wilson in his heyday exuded machismo and easily met the physical requirements for appearing larger than life. Few figures of fiction led lives that loomed as large as his, with his wheeling and dealing, hobnobbing at high levels, and involvement in intrigue and deception in the affairs of the nation and the world.

Mr. Wilson often impressed interviewers as an engaging raconteur whose stories, although fascinating and even plausible, could not always be verified or refuted. At a time of rising suspicions about the agency’s covert dealings, he came to epitomize the CIA renegade.

Mr. Wilson worked officially for the CIA from 1955 until 1971 and then for the Navy intelligence until 1976, becoming a specialist in running front companies that performed spy services while also making a hefty profit for Mr. Wilson.

Former CIA agent Edwin Paul Wilson died Sept. 10 in Seattle. (James M. Thresher/The Washington Post)

After leaving the government, Mr. Wilson became an arms dealer. The Libyan government of Moammar Gaddafi ranked among his most prominent clients. Mr. Wilson worked from bases in Libya, England, Switzerland and a well-appointed office in a townhouse on 22nd Street NW. He once owned a Fauquier County estate in the Virginia hunt country, where he entertained high government officials.

At the height of his influence, Mr. Wilson reportedly was worth $23 million.

His dealings ended in 1982, when he was lured from a safe haven in Libya to the Dominican Republic and arrested. Over the next several years, Mr. Wilson was tried four times on charges related to his dealings in Libya and other alleged transgressions.

In Washington, he was acquitted of soliciting the assassination of a Libyan dissident.

In Virginia, he was accused of illegally exporting a rifle and four pistols, including one used to kill a Libyan in Germany. He was convicted, fined $200,000 and sentenced to 15 years in prison (a term later reduced to 10 years).

In New York, he was accused of trying to hire a hit man to kill two prosecutors and several witnesses against him. He was convicted, fined $75,000 and sentenced to 25 years.

In Texas, he was accused of illegally exporting 20 tons of plastic explosives to Gaddafi’s repressive regime. At the time, it was described as the largest such deal in U.S. history. Mr. Wilson’s defense was that he had carried out the arms deal as part of an intelligence-gathering mission for the CIA. He was convicted in February 1983 and fined $145,000 and sentenced to 17 years.

He spent much of his imprisonment in solitary confinement. His marriage dissolved.

Over a period of years, Mr. Wilson used the Freedom of Information Act to obtain hundreds of pages of documents showing, he argued, that prosecutors had used false testimony to win his conviction.

In October 2003, a federal judge in Houston ruled that faults in a key piece of evidence probably prevented an acquittal in the Texas case.

That evidence was an affidavit from a high-ranking CIA official denying that Mr. Wilson had been requested “to perform or provide any services, directly or indirectly,” for the agency during the relevant period.

The documents unearthed by Mr. Wilson did not explicitly show that the CIA had ordered up the Libyan arms deal. But they did show, the court found, that the CIA had continued to engage in significant contact with Mr. Wilson after he left the agency in 1971.

“In the course of American justice,” the judge wrote, “one would have to work hard to conceive of a more fundamentally unfair process.”

The CIA continued to deny any involvement in the Libyan arms sale. “That decision was his,” the agency said in a statement the day the opinion was issued, “and that is why he went to jail.”

David Corn, the author of a biography of the prominent CIA officer Theodore G. Shackley, found irony in the episode. “They framed a guilty man,” Corn told The Washington Post in 2004. “I think he’s a terrible fellow who got what he deserved, but they did frame him.”

Edwin Paul Wilson was born May 3, 1928, on a farm in Nampa, Idaho.

He worked as a merchant seaman before attending the University of Portland, where he received a bachelor’s degree in psychology in 1953. He served in the Marine Corps and joined the CIA the day after his discharge in 1955. Early assignments included spying on European labor unions, The Post reported.

After his release from prison, he moved to Edmonds, Wash., to be near a brother. Having declared bankruptcy, Mr. Wilson reportedly lived largely off Social Security and a CIA pension.

Survivors, according to a death notice on the funeral home’s Web site, include his longtime girlfriend, Cate Callahan; two sons, Karl Wilson and Erik Wilson; and a sister.

“Deep down here,” Mr. Wilson told The Post in 2004, pointing to his heart, “I knew I wasn’t guilty. . . . That helped. If I had gone out and killed somebody, I’d feel guilty, I guess. But I don’t feel guilty over this.”