BLAUVELT, N.Y. - A former New York City police officer walked into a suburban middle school with a handgun yesterday but was wrestled to the floor by the district superintendent, who wrenched the weapon away and pinned him until police knocked down a door and arrested him, authorities said.

No one was injured at South Orangetown Middle School in Blauvelt, a bedroom community and hamlet of Orangetown about 20 miles north of New York City, authorities said.

The man, identified as Peter Cocker, walked into the school, brushing past a security guard, who saw the gun in Cocker's hand and made an emergency call around 11:45 a.m., police said.

Once inside the school building, Cocker headed to the South Orangetown Central School District's administrative offices, which are on the campus, and confronted district Superintendent Ken Mitchell, barricading the two of them in an office, police said.

A SWAT team and several police agencies sent units to the 800-student school, which was locked down. Officers tried to negotiate with Cocker, but when they heard the sounds of "violent struggle," they used a shotgun to blast their way through the office door, police said.

Authorities said that Mitchell had talked with the man to calm him down before wrestling him to the floor and taking the gun away.

"He managed to pin him down, and right then the police were there and broke down the door to his office and took the man away," said Orangetown Supervisor Thom Kleiner.

He called Mitchell's actions "an incredible bit of bravery and heroism." He described the superintendent as "not a very tall or aggressive-looking man. He's a slight guy, very unassuming."

Police said Cocker, 37, of Tappan, was arrested on charges of kidnapping, criminal use of a firearm, burglary, coercion and criminal possession of a weapon.

Police said Cocker, who retired from the New York Police Department in 2004, was the parent of a student in the district.

Orangetown police Chief Kevin Nulty said that a letter from the district regarding swine flu may have played a part in the incident. He didn't elaborate.

Parent Eleanor Klepper said the front door at the middle school is usually unlocked during the day and has a security guard posted there.

District spokeswoman B.J. Greco couldn't explain how Cocker had gotten past the security guard, but police commended the man's actions.

"I think the security guard did do the right thing," Nulty said, adding that the school and police followed an emergency plan developed in the wake of the 1999 Columbine High School massacre.

"At no time do we believe a child was in danger," Nulty said. *