Two men who had pleaded guilty to fatally stabbing another man 48 times were sentenced yesterday in a crowded Alexandria courtroom under intense security.

The sheriff's office, alerted that threats had been exchanged between the families of the deceased and the defendants, lined the courtroom with 10 deputies.

A bomb-sniffing police dog also inspected the courthouse before the sentencing -- which at the last moment was rescheduled for two hours earlier -- and a metal detector was placed at the front entrance of the courthouse.

The defendants, Jose Ovidio Blanco-Arriaza, 20, and Carlos Rodriquez, 21, citizens of El Salvador living in Alexandria, were indicted June 3 on first-degree murder charges in the stabbing of Jose Olegario Lopez Machuca.

In July, both pleaded guilty to first-degree murder after prosecutors said they would seek no more than 54 years for Blanco-Arriaza and 20 years for Rodriquez. Blanco-Arriaza was sentenced to 40 years; Rodriquez to 20.

After Alexandria Circuit Court Judge Donald H. Kent pronounced the sentences, the victim's 19-year-old half-brother, Jose Sarminto, walking out into the crowded hallway, said his family had hoped the men would receive life terms. Sarminto said his family, which he said included 28 brothers and sisters from two marriages, would discuss the sentences.

Lopez Machuca, 29, was pronounced dead April 10, about 40 minutes after police discovered his slashed body in the 3600 block of Commonwealth Avenue near Cora Kelly Magnet School.

The motive for the killing was not made clear during yesterday's proceedings. Blanco-Arriaza told Judge Kent he slashed the victim as a favor to Rodriquez, who Blanco-Arriaza said wanted to avenge the killing of his grandfather and the assault of an aunt.

Rodriquez denied Blanco-Arriaza's statement and said he stabbed the victim because a woman he worked for at an Old Town restaurant asked him to after Lopez Machuca sexually assaulted her.

Through an interpreter, Blanco-Arriaza told Kent before sentencing: "I am sorry for what I did because it is against the law in this country. I regret it as a military man . . . . I must be in jail the way the state asks."