DENVER — A judge sentenced two men on Friday to decades in prison for the shooting death of a man at a Denver train station that sparked debate about illegal immigration.

District Court Judge A. Bruce Jones ordered 58 years in prison for Nathan Valdez, who pleaded guilty in February to second-degree murder and other charges in the killing of 32-year-old Tim Cruz. Jones sentenced Ever Valles to 29 years.

Prosecutor Adrienne Greene said the two men approached Cruz near a light-rail station early Feb. 7, 2017, and talked casually with him before Valdez pulled out a gun.

Greene said surveillance video shows that both men advanced toward Cruz before Valdez fired, hitting Valles in the buttock.

Valdez then fired twice at Cruz, killing him, she said.

The case drew the attention of Attorney General Jeff Sessions last year as criticized sanctuary city policies.

Valles had been held in the Denver jail months before the shooting on an auto theft charge. Officials gave immigration authorities about 25 minutes of notice before releasing Valles, a native of Mexico.

Valles' attorney said Friday that the defendant's parents brought him to the U.S. when he was eight months old.

He pleaded guilty in November to aggravated robbery and accessory to murder under a plea deal in the case.

Valles was expected to testify against Valdez until Valdez entered his guilty plea.

About 20 of Cruz's family members and friends filled half of the courtroom during Friday's sentencing.

Several wore T-shirts printed with an image of Tim Cruz and cried as his sister, Sherry Montoya, spoke about her family's loss.

Montoya said her younger brother loved spending time with his mother and other family members. He was an artist who also enjoyed playing video games with his nieces and nephews and played the guitar, she said.

Growing up, Montoya said she told her brother that she would always be there to hold him and hug him.

"We will never get to hold and hug him again because you took that from us," Montoya said.

Valdez and Valles, who are both 20, apologized and said they didn't mean to kill Cruz.

But the judge said Cruz's death "was not an accident."

"This is what happens when young men have guns and decide to take what isn't theirs; not just property but life," Jones said.

Valles was not armed but knew that Valdez had a gun when the men decided to rob Cruz, Greene said. She said he helped ensure Cruz couldn't run away.