A Montgomery County Circuit Court judge, rejecting charges of racial discrimination, sentenced two Northern Virginia men yesterday to life in prison without the possibility of parole for the execution-style slayings of two men last year in a Silver Spring apartment.

Anthony Wells Jr., 28, and Kevin Hernandez, 27, were convicted of first-degree murder and armed robbery in the Oct. 4 killings of William Williams Jr., 19, and Earl Jerome, 18. According to testimony at the trial, Wells and Hernandez were recruited by Frank Miranda, 19, to help him retrieve an $800 gold nugget bracelet from one of the victims.

Yesterday, Judge William M. Cave, who expressed sympathy to the victims' families present in the courtroom, imposed the maximum sentence recommended by prosecutors for Wells and Hernandez. "Society should never again run the risk of an opportunity for Hernandez to commit this offense again," he said.

Prosecutor Thomas A. Tamm said Wells and Hernandez were the triggermen who shot Williams and Jerome while they were lying face down on a bed. Each man was shot in the head and the back.

Hernandez questioned Cave's decision to give him the maximum sentence, since Cave earlier had sentenced Miranda to 10 years in prison. Miranda is white; Wells and Hernandez are black. "If you are white, you go forward," Hernandez said. "If you are black, you fight your way every step."

But Cave said "ethnic or racial differences have absolutely no place in this crime or this sentence." Both victims were black.

Tamm said yesterday he sought life without parole sentences for Wells and Hernandez because they fired the fatal shots and had prior criminal records.

Wells and Hernandez maintained their innocence yesterday. "It's very difficult to accept that I am the triggerman for two young men," said Wells. "I did not kill anyone," said Hernandez.

Because of objections from the prosecution, Cave will resentence Miranda next week.