The Buckley family at an Oceanside High School football game last fall, dedicated to the slain Marine shortly after he was killed in Afghanistan.

Four days after two Oceanside brothers memorialized their older brother — a Marine who was killed in Afghanistan last year — the teens allegedly joined two neighborhood friends in beating two men in Babylon while shouting anti-gay slurs at them, according to court documents.

The four Oceanside residents — Justin Buckley, 17, Shane Buckley, 18, Nicholas Battaglia, 18, and Gregory Gilbert, 20 — were all charged in First District Court in Islip with assault as a hate crime on July 23. In addition, Shane Buckley, Gilbert and Battaglia were charged with gang assault.

County prosecutors allege that at about 3:30 a.m. on July 21, the two Buckley brothers, Battaglia and Gilbert were walking on Deer Park Avenue in Babylon when they called across the street to ask two men how to get to the nearby train station. Words were apparently exchanged between the four Oceanside men and the two Babylon men.

“The four assailants started yelling anti-gay slurs, crossed the street and attacked them,” Suffolk County Assistant District Attorney Lawrence Opisso said. The victims were taken to Good Samaritan Hospital Medical Center in West Islip, according to court documents, where one was admitted with a broken nose.

On July 17, which would have been their brother Gregory’s 22nd birthday, Shane and Justin Buckley had joined family and friends at Oceanside Park at dusk to launch 22 luminary balloons to honor their brother. Four days later, they were in handcuffs.

Family members said they did not believe the hate crime charge. Gregory Buckley Sr., Shane’s and Justin’s father, described them as “great kids,” denied that they are homophobic and said that police are “blowing [the incident] out of proportion.”

“No way — not in a million years,” Buckley said of the allegations that his sons committed a hate crime.

Opisso, however, said that blood was found on Shane Buckley’s sneaker, and he added that more serious charges could yet be filed. Opisso declined to say what triggered the fight, which was broken up by an off-duty New York City police officer who happened to see the incident.

Defense attorneys said that the two Babylon men started the fight with insults after being asked how to get to the train station.