A Bosnian immigrant traded one war zone for another when she became a New York City teacher — enduring years of racial, sexual and physical abuse from her middle-school students, a lawsuit charges.

Aida Sehic, 48, says rampaging pupils broke her nose with a bag of metal rulers, stabbed her with a mechanical pencil, demanded sex acts, trashed her classroom and hurled epithets at her including “white bitch.’’

“I was relieved when I came here because I no longer had to worry about the war,” said Sehic, who lost a relative during Balkan ethnic strife in the early ’90s. “I thought I could leave that behind.”

When the beaten-down teacher tried to appeal to the parents of one assailant, the kid mocked her, saying, “When my mother comes in tomorrow, she’ll deck you,” Sehic’s Manhattan federal suit says.

The teacher says she repeatedly reached out for help from everyone from school administrators to her union and cops, only to be targeted for termination because she sought help.

In 2016, Sehic was hit with disciplinary charges from the city Department of Education in an effort to fire her for incompetence, she says.

Meanwhile, her teen attackers were never removed from her class and rarely punished, her suit says.

The charges “sought to blame her for unruly classes that resulted from the administration’s failure to protect her and discipline students who were allowed to repeatedly racially and sexually harass her without disciplinary consequences,’’ according to her suit, which was filed by lawyer Bryan Glass.

Sehic says she now has PTSD from being in the classroom.

According to her suit, she was first hired by the DOE in 1999 and became a full-time tenured teacher at IS 143 in Washington Heights in Manhattan.

In 2011, she was then placed on the Absent Teacher Reserve — a program for teachers without permanent gigs — because of budget cuts and then temporarily placed at IS 218 in the Bronx in 2012, her suit says.

There, students lampooned her background and accent before a female student chucked a bag or rulers at her nose and broke it, her suit states. Despite her formal complaints, no one was punished, according to the suit.

“Some kids wanted to learn but there were those who wouldn’t let them,” she said. “You can’t kick the kids out and the administration blames you. What can you do as a teacher?”

Assigned to MS 322 in Upper Manhattan the next year, Sehic said, the abuse continued. One student screamed that Sehic was “a f–king ugly white bitch” as the teacher walked near the school with her two young children, the suit alleges.

Sehic said that after administrators ignored her complaints, local cops told her that it was the school’s responsibility to address her concerns.

Sehic was then placed permanently back in her original school, IS 143, where more abuse was piled on, she said. She said she repeatedly complained, to no avail.

“It was horrible, it was toxic,” she said. “In a way it was worse than the war because now I had two kids to take case of an no extended family.”

In June 2016, Sehic, who had received several poor ratings for inadequate classroom management, was brought up on several charges and marked for termination. She was fined $7,500 by an arbitrator who upheld some charges and dropped others after a hearing last year, the case states.

The DOE said Tuesday that Sehic failed to execute lesson plans and neglected her duties and is currently placed at City College Academy of the Arts junior high school in Upper Manhattan.

Sehic is suing the DOE and school officials.

“They need to acknowledge that they were wrong and they should never treat a competent, talented, dedicated teacher like this again,” Sehic said.