A Cuban spy who dug ditches and fixed vents for six years while counting planes at a Navy base in the Florida Keys received a life prison sentence Thursday.

Antonio Guerrero was one of 14 secret agents allegedly assigned by Havana to infiltrate U.S. military bases and exile groups in south Florida.

Although none of the agents got any U.S. secrets, U.S. District Judge Joan Lenard said Guerrero's "illegal activities were for the sole purpose of obtaining national security information."

Guerrero is the last of five agents to be sentenced following a six-month trial. The others received prison terms ranging from 10 years to life for espionage conspiracy and lesser counts. The remaining accused spies have entered pleas or are believed to have fled to Cuba.

Guerrero worked to warn Havana about signs of a U.S. invasion of Cuba. He reported on military flights, aircraft and changes of command at Key West Naval Air Station.

In a 15-minute speech before sentencing, Guerrero, 43, a U.S. citizen who was born in Miami, rejected the verdict as "sacrilege" from "a jury incapable of handing down justice."

In speeches at their sentencing hearings, the other agents have defended their espionage as a fight against terrorist attacks they claim have been committed by Miami exiles in Havana.

Guerrero "is a patriot, a patriot for a country that we don't agree with," said his attorney, Jack Blumenfeld. "He served his people."

But prosecutor Caroline Miller said the case "is not about people having the right to love Cuba."

"He is firmly committed to the interests of a foreign nation, no matter what it takes, no matter what laws of the United States he breaks," she said.

In Cuba, the government has organized marches in the agents' honor, and their case has been widely reported on television and radio.

President Fidel Castro called the agents "heroes" this month and denied they threatened U.S. security.

"Justice will triumph," said Randy Alonso, moderator of the government's nightly "Round Table" program, dedicated Thursday night to Guerrero's sentencing. "We won the battle of Elian and we will win this new battle."