NEW YORK – The last NYPD police officers assigned full-time to New York City public schools are being moved out when there is a nationwide call for increased school security in the wake of the Parkland shooting last month.

As the nation mourned the 17 victims of the school massacre at Marjory Stoneman Douglas High School in Parkland, Fla., the NYPD was removing Sgt. Raul Espinet from his post at Francis Lewis HS in Fresh Meadows, Queens. The sergeant had worked there for more than a dozen years. Parents, teachers and students are livid over the beloved cop’s departure, reported New York Post.

“My colleagues think it’s outrageous — and really stupid,” teacher Arthur Goldstein said. “We’re not enthusiastic about arming teachers, but we liked having a cop around.”

Espinet’s position was eliminated because cops in Mayor de Blasio’s new community policing units will visit schools while patrolling the neighborhood, according to the NYPD. School “safety agents” are stationed at all schools, but are not armed.

The once-common practice of putting an armed cop in schools waned in the 1990s. Moreover, all schools were gradually eliminated, but Francis Lewis, one of the biggest high schools, slipped by. Furthermore, Bayside and Benjamin Cardozo high schools also recently lost their full-time NYPD officers, according to parents.

Espinet is one of the last — if not the last — school cop to be eliminated.

“I’m not aware of any other school with a full-time police officer assigned to it,” said Lt. John Grimpel, an NYPD spokesman.

As a result of the controversial, parents at the overcrowded Queens school, crammed with more than 4,400 students, are protesting the change.

“The community officer is in no way an acceptable replacement,” says a PTA petition launched last week.

The PTA is demanding that the NYPD and city Department of Education bring back an armed cop to Francis Lewis. They have collected more than 1,000 signatures in just two days, according to co-president Linda Lovett.

“It’s ridiculous,” Lovett said. “All over the country they are telling you ‘arm the teachers, get an officer in your school.’ New York City had a designated officer and they are actually cutting the program . . . they are making us less secure.

“You are talking about 5,000 people in a one-block radius, and you’re telling me you can’t designate one officer?”

Students, parents and teachers agree the school is generally safe. They say fights are rare, but the Parkland shooting and one teenager’s recent online threat against Francis Lewis HS have put them on high alert.

“There are school shootings everywhere, and they took the one armed officer away from a school with 4,000 kids in it,” said sophomore Josephine Li. “Who is there to protect [us]?”

Espinet was a constant presence, according to students and staff. He’d be seen in the hallways and outside the building. He ensured doors were locked and busted kids for smoking, according to the Post.

“He knew what was happening,” said Phyllis Leibowitz, an English teacher who served 16 years as a dean. “Kids told him things . . . They would give him a heads up, and he would handle it before it happened.”

Espinet attended school meetings on a regular basis. More importantly, he made suggestions on how to make the school safer, staffers said. The sergeant also spoke to classes about careers in law enforcement and took troubled kids under his wing. Consequently, he wasn’t simply a campus cop, but a mentor.

“He was as much of a social worker as a police officer,” said Al Lahood, a social studies teacher. “He was part of the school community. Without him . . . there’s a vacuum, a piece that’s missing.”

Others said Espinet’s presence was a “deterrent” for crime and they worry his absence invites bad behavior.

“It’s not like he was standing there with a gun out,” Lovett said. “He knew everybody. When you get to know everybody, crime goes down.”

Espinet, 50, was transferred to an NYPD unit that evaluates recruits.

The transfer was ill-timed. The move comes as towns across the country are putting armed cops in schools in the wake of the Valentine’s Day massacre in Florida.

In New York, Staten Island City Councilmen Steven Matteo and Joe Borelli, and Borough President James Oddo, have asked de Blasio for armed officers in all of the city’s 1,700 schools — something the mayor has long argued would cost too much.

However, Matteo reiterated his plea in light of Espinet’s reassignment.

“I hope the NYPD and the administration listens to parents and students in the Fresh Meadows community and allows this officer to stay where he has obviously had such a positive impact,” he said. “Sadly, we live in a world where horrific attacks on our children have become a regular occurrence, but fortunately we also have the greatest police department in the world to protect us.”