By Jiri Skacel

BRNO, Czech Republic (Reuters) - A Czech court sentenced U.S. citizen Kevin Dahlgren to life in prison on Wednesday for stabbing to death a family of four of his relatives whom he had been visiting in 2013.

The court handed Dahlgren, 24, from Palo Alto, California, the maximum penalty for murdering his Czech aunt, uncle and two male cousins aged 23 and 17 in the city of Brno, then attempting to burn their bodies.

"He maliciously attacked four members of the family who had been kind to him, who had given him shelter, who had helped him, who had done him no wrong ... and murdered all four of them in a very brutal way," Judge Michal Zamecnik said in his sentencing. "He wiped out a whole family."

Life sentences are rare in the Czech Republic, which has only 48 prisoners serving the maximum term.

Dahlgren fled to the United States after the murders but was detained at Prague's request and found to have shorts in his luggage with traces of blood matching that of the victims.

He was sent back in 2015 in the first-ever extradition of an American to the Czech Republic.

Prosecutors said Dahlgren, whose parents attended the court hearings, had stabbed or cut three of his victims between 17 and 29 times.

He then used a stone as well as a knife to kill the younger cousin, who returned home from school as Dahlgren was attempting to clean up after the first three murders.

Dahlgren refused to testify in the case. His defense cited American evaluations that Dahlgren was mentally ill, but the judge said that, although his cognitive abilities were lower, Dahlgren was sane.

(Additional reporting by Robert Muller; Writing by Jason Hovet; Editing by Kevin Liffey)