The six officers were executed by a firing squad while the two civilians were hanged, the radio said. A Libyan official contacted by telephone said that the sentence had been issued by the Supreme Military Court on Wednesday.
The radio station, monitored in Tunis, said earlier that the men were convicted of belonging to "a banned organisation linked to agents of foreign governments", and of passing defence secrets to foreign states.
It did not name the governments but said that the convicted men used CIA-supplied equipment and implied they were spying for the Inited States.
In Washington, US officials dismissed the trial as a propaganda ploy. "This is not a new case and the proceedings have a show-trial flavour," one official said. "They look like a propaganda ploy for internal consumption."
The CIA declined comment.
A Tripoli-based diplomat said: "The report is the first public admission of opposition within the military to the rule of Colonel Muammar Gaddafi."
Libya's state-run television on Wednesday night broadcast footage of the trial room.
A prosecutor was seen to tell the men: "Have you forgotten or are you just playing down what those who recruited you as spies, have done to us? They killed our children - raided our families as they were sleeping." He was apparently referring to the US bombing of Tripoli and Benghazi in 1986.
Six other officers and two civilians were acquitted by the court, showing that the "revolution is able to be clement when there is lack of evidence", the radio said.Reuse content