ALEXANDRIA, Va. — Former FBI agent Robert Hanssen, branded "the cruelest kind of thief" by U.S. prosecutors, was sentenced Friday to life in prison without parole for spying for Moscow. It closed a chapter in one of America's most-damaging espionage scandals.

"I apologize for my behavior. I am shamed by it," Hanssen, 58, told U.S. District Judge Claude Hilton. "I have opened the door for calumny against my totally innocent wife and children. I have hurt so many deeply."

Standing in a green prison uniform before the judge, Hanssen thanked his family, friends and co-workers who have expressed support, saying he was "humbled by your generosity, your goodness and your charity." Some of his former FBI colleagues were in the packed, hushed courtroom in this Washington suburb.

The sentencing ended the Hanssen courtroom saga. But the effects of what authorities describe as his extraordinary betrayal for cash and diamonds will resonate for years through the FBI and the U.S. intelligence community. .

When Hanssen was brought into the courtroom around 9 a.m. EDT, he greeted his lawyer, Plato Cacheris, warmly, and scanned the courtroom for faces he recognized. His hair had turned gray and he seemed to have lost weight since he was caught.

U.S. Attorney Paul McNulty told reporters: "This brings to a close one of the darkest chapters of American history. Robert Hanssen was trained and he was entrusted to guard us. He betrayed us. He turned his back on us."