Anthony, who would have been 24 years old this year, was kidnapped as he played with his brother in an alley behind his family's home on April 4, 1997. His battered, nude body was later found in the desert.
"As a prosecutor, this is one of the scariest cases I've ever dealt with. It's the type of case that I go home and have nightmares about it," said Otis Sterling, supervising deputy district attorney.
Family and friends spoke about Anthony at the sentencing, remembering him as a joyous boy who enjoyed playing with his brothers and sisters. Duncan sat in silence as Anthony's father Ernesto Martinez gave an emotional statement, choking up as he spoke.
"As a father I would love nothing more than to carry out Joseph Duncan's execution with my own two hands," Martinez said.
Duncan, 48, did not speak in court and showed no reaction as Superior Court Judge David B. Downing handed down the sentence.
"I can say in my 31 years being involved in the criminal justice system, I've never met a more evil person than Joseph Duncan," the judge said.
Duncan had pleaded guilty in March and waived his right to an appeal in an agreement with prosecutors. The Riverside County District Attorney's Office had originally sought the death penalty, but the Martinez family pushed for the deal in order to avoid a trial and re-open old wounds.
Duncan was already facing three death sentences and multiple life terms for the murder of an Idaho boy and his family.
"Certainly every family wants justice for their child, every family wants justice, but should it have never come here and Duncan still died, I still would have been completely satisfied," said Anthony's mother, Diana Reed.
Authorities will return Duncan to death row at a federal prison in Indiana in the next few days, District Attorney spokesman John Hall said.
Duncan was sentenced to death in 2008 for the murders of 9-year-old Dylan Groene of Coeur d'Alene, Idaho, and three members of his family. He abducted the boy and his 8-year-old sister, Shasta, after killing their older brother, mother and her fiance with a hammer at the family's home in 2005.
Duncan took the children to a remote campsite in western Montana where he raped, tortured and threatened them before shooting Dylan in the head and burning his body.
Duncan previously had been sentenced to 20 years in prison for sexually assaulting a 14-year old boy in Tacoma, Wash., in 1980. He was paroled in 1994 but was returned to prison in 1997 after breaking the conditions. He was released in 2000 and lived in Fargo, N.D., before his arrest in the Idaho murders.
The Associated Press contributed to this report.