A Rockville Centre police officer pleaded not guilty Wednesday to a felony assault charge after authorities unsealed an indictment accusing him of beating a man in the head with a Taser following a fight outside a bar, and then falsifying paperwork about it.

But an attorney for Officer Anthony Federico, 36, of Nesconset, said at the Nassau County Court arraignment that the cop only had used “reasonable force” to defend himself and make an arrest during the May 2016 incident on South Park Avenue.

Federico faces up to 7 years in prison if convicted of second-degree assault, the top charge against him in a grand jury’s six-count indictment. It includes a charge of third-degree assault, and two counts each of falsifying business records and offering a false instrument for filing — all misdemeanors.

Acting State Supreme Court Justice Teresa Corrigan released the 11-year police veteran, who is married and has a 2-year-old son, on his own recognizance Wednesday after he surrendered to prosecutors for the arraignment.

Federico, who spent 8 years with the NYPD before joining Rockville Centre’s police force three years ago, left court without commenting as more than 200 fellow law enforcement officers held a rally outside to support him.

“We are confident that as this case unfolds and the full facts come out and are developed in court that Officer Federico will be exonerated in the end,” defense attorney William Petrillo told the crowd.

But Nassau District Attorney Madeline Singas said in a statement later Wednesday that it was the obligation of prosecutors “to follow the evidence,” which in this case had led to a police officer’s indictment.

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.

A cellphone video that captured part of the May 8 event, which began at about 2:45 a.m. outside The Dark Horse Tavern and continued near Croxley’s Great American Ale House & Beer Garden, is expected to be a key piece of evidence in the case.

Assistant District Attorney Robert Cavallo told the judge his office had “meticulously investigated” the case and while the video “does speak for itself in many respects,” there were “various gaps” prosecutors will rely on witnesses to fill.

The Nassau district attorney’s office has alleged Federico used excessive force by striking a 25-year-old man on the top of his head with a Taser, and causing a 6-centimeter laceration that needed sutures and staples.

Prosecutors said Federico was investigating a fight that had just happened between two groups of young people when he encountered the 25-year-old. The 25-year-old’s brother, age 20, was helping his sibling off the ground after both had been in the fight when Federico tried to get information from them, prosecutors said.

But a physical confrontation began between the siblings and Federico, prompting the officer to use the Taser on both brothers and discharge the weapon several times, prosecutors said.

Court records show there is no mention of Federico having hit anyone in the head with the Taser in department reports that document his use of the weapon.

Petrillo told the judge the 25-year-old struck his client in the face before the video started.

He said the 25-year-old grabbed Federico in a headlock and put another hand by the officer’s weapon. Petrillo said the 20-year-old brother kicked Federico while Federico was trying to subdue the sibling.

A woman was recording video with her cellphone, Petrillo said. Records show police also arrested a 24-year-old woman that night on a disorderly conduct charge.

Court records identified the brothers as Kevin Kavanagh, now 26, the alleged beating victim, and his brother Brendan Kavanagh, 20.

The older brother faces charges of attempted assault on Federico and resisting arrest from the May incident. The younger brother faces charges of resisting arrest, obstructing the law and possessing two phony driver’s licenses.

Their attorneys, Garden City lawyer Daniel Russo and Queens lawyer Dennis Ring, said in a joint statement Wednesday that the Rockville Centre residents had “suffered a violent assault by a police officer and then were wrongfully arrested.”

A spokeswoman for the village of Rockville Centre said Wednesday that Federico was on modified duty and would be working in the police department office and without a gun.