NEW YORK (AP) _ A 17-year-old boy has been charged with taking part in an attack on three black teen-agers by a gang of white youths armed with baseball bats, pipes and a broken glass tube, a police investigator said today.

Alphonso Petti was arrested after several suspects were identifed by the victims who looked through a 1987 South Shore High School yearbook. Police said the investigation was continuing and more arrests were expected.

Petti was charged with assault, riot, aggravated harassment and violating the state civil rights code, said Sgt. Maurice Howard, a police spokesman.

The attack began about 11 p.m. Wednesday as the black youths, who were on their way home from their jobs as clerks at a supermarket, were waiting for two female co-workers to buy bagels in a shop in the Canarsie section of Brooklyn. Two of the victims, Ewan Lawrence, 17, and David Smiley, 19, all of Brooklyn, were treated for cuts and bruises at Brookdale Hospital and released. The third, Michael Washington, 19, was not injured.

''These were good kids. They were hardworking children,'' Inspector Michael Markman, the head of the police department's Bias Incident Investigations Unit, said Thursday.

There was some indication the assailants were drinking, the inspector told reporters at a news conference.

As two of the victims left the store, a group of 20 or 25 white teen-agers coming from a nearby park began shouting racial slurs, said Michael Julian, a police spokesman. Some of the youths were armed with baseball bats, pipes and at least one was carrying a broken flourescent light tube, he said.

Washington, who was walking his bicycle, rode away to call police, but about 10 of the whites caught up with Smiley and Lawrence several blocks later, Julian said.

Julian said Lawrence was bashed in the upper right arm with the broken flourescent tube and struck in the head with a baseball bat when he tried to help Smiley, who said he was punched and kicked by several youths.

By the time the police arrived most of the white youths had fled. Julian said the three victims initially refused to identify their attackers or accept medical help.

The attack had many similarities to last December's racial assault in Howard Beach, Queens, in which a bat-wielding group of white teen-agers allegedly chased and beat three black men. One of the three, Michael Griffith, died after being chased onto the Belt Parkway and struck by an oncoming car.

A dozen youths were arrested in that attack and face trial later this month.