Robert Iler, who plays the rebellious, pot-smoking son of a mob boss on HBO's The Sopranos, pleaded guilty Tuesday to mugging two youths and stealing $40.

Iler, 17, admitted to misdemeanor petty larceny in return for a sentence of three years' probation. Iler was granted youthful offender status, and his record will be sealed.

A co-defendant, Alban Selimaj, 17, entered the same plea.

The two were originally charged with second-degree robbery for the incident last July 4. A conviction on that charge carried a penalty of up to 15 years in prison.

Iler told the judge he and Selimaj spotted two youths walking toward them and decided to "hassle" the pair. Iler was arrested a few blocks away.

Iler's lawyer, Robert Morvillo, said the plea deals were "fair and just."

"My view is that he was a 16-year-old boy in the wrong place at the wrong time and didn't have enough sense to walk away," Morvillo said.

After the plea, Iler's manager, Jeff Mitchell, read a statement in which the actor apologized "for all the grief and trouble everybody went through."

A third suspect, Michael Cournede, 20, still faces trial on the robbery charge. He has pleaded innocent. A fourth suspect who was 15 was turned over to juvenile authorities and his case is being handled by Family Court.

Iler portrays the troubled Anthony "A.J." Soprano Jr. on the HBO television hit about gangland life, The Sopranos.