A 19-year-old Rockville man was sentenced to 34 years in prison yesterday for his role in a Gaithersburg home invasion robbery last winter in which another teenager was fatally shot in the face.

Joshua Friedman pleaded guilty in June to second-degree murder, attempted second-degree murder and several other felony charges stemming from the Jan. 11 incident in which he and two teenage females sought to rob a group of teenagers from whom they had been buying drugs--including $60 of diluted cocaine.

The victim of the fatal shooting was Ali Rabonik, 18, whose parents were both killed when he was a young boy in his native Iran. Rabonik was killed by a blast from a shotgun that Friedman had carried into the home on Brucar Court.

Montgomery County Circuit Court Judge Vincent E. Ferretti Jr. sentenced Friedman to a total of 105 years but suspended all but 34 years. Friedman could be eligible for parole in 17 years.

"I apologize from the depths of my heart to Ali Rabonik's family," Friedman said, looking briefly at the victim's relatives sitting in the first row of the courtroom, "and hope that some day you'll be able to forgive me."

"This is nobody's fault but yours," Ferretti told Friedman as he imposed the sentence.

There were pleas for leniency, including one from Friedman's father. Bruce Friedman said his son had struggled with drug abuse and a troubled family life: His mother suffers from bipolar disorder that had led to erratic and delusional behavior as well as the breakup of their marriage. But he said his son had never before been violent.

The victim's brother, Nezam, also addressed the court, and in an allusion to Friedman's troubled past, he said: "My brother lived through a lot of stuff. We both lived through a lot of stuff. But he never would do something like that. There's nothing anywhere that says you can take somebody else's life."

According to police and a statement by prosecutors at the time of his plea, Friedman entered the house with Shiva Dayani, 17, who was armed with a handgun and a knife. A third defendant, Chelsa Sommer, 17, who was Friedman's girlfriend, waited outside the house in a getaway car. The threesome was seeking revenge on the occupants of the house, who allegedly had sold Dayani bad drugs.

Friedman and Dayani found five people in an upstairs bedroom, ordered them to the floor and tied them up with duct tape, according to the prosecutor's statement of facts. Another resident of the house entered the room and tried to disarm Friedman. During the struggle, Friedman's shotgun went off, striking Rabonik.

Friedman, Dayani and Sommer all pleaded guilty in connection with the killing. Dayani and Sommer will be sentenced this fall.