(AP) -- A former University of Tennessee student who hacked into Sarah Palin's e-mail during the 2008 presidential campaign was sentenced Friday to a year and a day, with the judge recommending a halfway house instead of prison.
U.S. District Judge Thomas W. Phillips also said David Kernell, 22, should get mental health treatment, based on defense comments Friday that he has had conditions including depression since he was 11.
Kernell hugged family members and friends after hearing the sentence. He declined comment as they left the courthouse with his attorney.
He was an economics major when he deduced the answers to security questions and read e-mail in Palin's private Yahoo account.
The former Alaska governor and her daughter Bristol testified at the trial in late April that the hacking, followed by Kernell's online bragging and providing the password and Palin family telephone numbers to others, caused them emotional hardship. Palin previously declined comment about Kernell's sentence and said it should be up to the judge.
The prosecutors' pre-sentence filings said Kernell, a Democratic legislator's son, had posted online that he found "nothing that would derail her campaign as I had hoped, all I saw was personal stuff, some clerical stuff from when she was governor ... And pictures of her family ... I read everything, every little Blackberry confirmation ... all the pictures, and there was nothing..."
The judge rejected a recommendation by prosecutors that Kernell be sent to prison for 18 months.
Kernell will not start the sentence until the Bureau of Prisons decides the location of his confinement, probably in about 45 days.
"They usually take the recommendation but they are not required to," the judge said.
Kernell, smiling at times after the sentence was announced, spoke during the hearing and apologized.
"I am not going to make any kind of excuses," he said. "I'd like to apologize to the Palin family."
Kernell said that "for the rest of my life I am going to be ashamed, feel guilty for what I have done."
Kernell was convicted of unauthorized access to a protected computer and destroying records to impede a federal investigation. Jurors acquitted him of wire fraud and deadlocked on an identity theft charge.
Records show the maximum possible penalty for destroying or concealing records to impede an investigation is 20 years and applying the guidelines to Kernell, the penalty range was between 15 months and 21 months.
Palin did not attend the sentencing and her attorney did not immediately answer an e-mail request for comment about the sentencing Friday.
A statement on Palin's' Facebook page after the trial compared the case to the 1972 Watergate break-in at Democratic headquarters that eventually led to President Richard Nixon's resignation.
"As Watergate taught us, we rightfully reject illegally breaking into candidates' private communications for political intrigue in an attempt to derail an election," the Facebook posting said.
Phillips said during the hearing that the sentence was not based on any victim's notoriety.
"The importance of privacy, regardless of the individual, needs to be protected," he said.
The judge said a "firm but not a reactionary sentence is required in this case."
Explore further: Facebook goes retro with 'Rooms' chat app