An eighth-grader was shot in Hempstead Village and two people were arrested in what is being investigated as a possible gang-related crime, authorities said Wednesday.

A group of at least three people beat the boy outside Franklin Street storefronts near Centre Street about 6:30 p.m. Tuesday, police said, and the fight ended when one attacker fired two shots, police said.

One bullet struck the victim's pelvis, seriously injuring him, according to court papers.

"It looks like they just crossed paths and there was some bad blood between the victim and the other group," Hempstead police spokesman Lt. Derek Warner said. “I don’t have the motive right now, the reason, animosity, pre-existing condition — I’m not sure of that right now."

Officers were nearby when the shots rang out and they chased the suspects and captured Maicol Figueroa, 20, of Hempstead, and a 14-year-old boy a few blocks from the shooting, Warner said.

The victim, 12, a student at Alverta B. Gray Schultz Middle School in Hempstead, underwent surgery and was in stable condition Wednesday, Warner said.

"It's way too young to be a victim of this activity," the lieutenant said.

Sign up for The Classroom newsletter. Education on Long Island is changing. Find out how. By clicking Sign up, you agree to our privacy policy.

Surveillance footage showed Figueroa with a gun, and he later wrote a confession admitting to the shooting, according to the complaint against him. Warner said the gun, a revolver, was seized from him.

Figueroa, of South Franklin Avenue, was arraigned Wednesday on charges of first-degree assault and second-degree criminal possession of a weapon. He was held pending payment of bail set at $500,000 bond or $250,000 cash, online court records show.

He was represented by The Legal Aid Society of Nassau County, which has a policy of not commenting during the arraignment stage of a case.

The name of the 14-year-old was not released because he was charged as a juvenile with two counts of criminal possession of a weapon, police said. It was not immediately known if he had an attorney.

The teenager also attends the same middle school, Warner said, and investigators are trying to determine if there was any animosity at school between the two youths.

Hempstead Village police are still looking for at least one other person involved in the confrontation. They ask anyone with information to call them at 516-483-6200.