As an officer in the Israel Defense Forces, Ofir Dayan served in hostile territory in Gaza and Lebanon. But, the undergrad told The Post, nothing prepared her for life at Columbia University.

Ofir, the 24-year-old daughter of Israel Consul General in New York Dani Dayan, said she is harassed and threatened over her background by the group Students for Justice in Palestine (SJP), and that the school is failing to protect her.

“SJP is violent,” she said. “I’m worried about my personal safety.”

The political science major had her initial run-in about a month into the fall 2017 semester, when she was in the lobby of Knox Hall — home to the Middle East Institute — having a phone conversation in Hebrew.

“A girl heard me and started screaming, ‘Stop killing Muslim ­babies! . . . You’re a murderer!’ ” Ofir said. “Then she screamed, ‘Zionist, get out!’ A nearby public-safety ­administrator did nothing.”

In October 2017, Ofir said, she and four members of Students Supporting Israel (SSI) — she is the vice-president of the Columbia chapter — were leaving an on-campus event for Israeli beauty queen Titi Aynaw. “The ­moment [members of SJP] saw us, they started screaming their slogans with a microphone to intimidate us. There were at least 50 SJP members blocking the walkway.

“They were really angry and it was scary,” said Ofir, a vocal supporter of the Jewish state. “I believed it would escalate to physical violence.”

Ofir and SSI filed a complaint about the incident to the Student Governing Board (SGB) in January. It ­described, in part, “horrified and terrified Jewish students huddled together while surrounded by a raging mob . . . [exhibiting] physically threatening behavior.” She also submitted cellphone video that she had recorded of the protesters being “hostile.” (Dalia Zahger, chapter president of SSI, agreed that the incident was “really scary.”)

‘I thought the university would protect me, but they didn’t do anything when [protesters] called me a terrorist.’

Ofir added that things intensified after February 2018, when her father delivered a speech on campus. She said that a few dozen SJP protesters set up mock checkpoints to intimidate attendees. When Ofir was handed a flier about the “war criminal” consul general, she revealed that Dani was her dad.

In March, Ofir said, SJP members screamed “terrorist” at her and others handing out literature during Hebrew Liberation Week.

The head of SGB told SSI that the complaint should instead be filed with the school’s newly formed adjudication board, a student-run group whose purpose is to meet with both parties in a complaint to settle differences.

About a month later, the SSI student president sat down with a university administrator who is an adviser to the adjudication board. That official told the student that the complaint was not eligible for adjudication because it was from a previous semester and it was too complicated for the student-run board to handle. She then dismissed the complaint in late March. SSI tried to appeal at a subsequent meeting.

Ofir is frustrated that the adjudication process never happened. “They were blowing us off,” she said.

At a meeting over the summer, an administrator told SSI that the school cannot do anything absent proof of anti-Semitism.

“I thought the university would protect me, but they didn’t do anything when [protesters] called me a terrorist,” Ofir said. “The school stands by as I’m harassed.”

Professor Suzanne Goldberg, executive vice president for university life, said in a statement: “The safety and well-being of all of our students is fundamentally important . . . we will always work with students who have concerns about their physical safety, allow debate on contentious questions where our students hold strong views, and provide essential personal and group support.”

Last year at the University of California, Irvine, an SJP chapter was issued a two-year probation for disrupting an on-campus pro-Israel event. The same group had been sanctioned in 2016 for “threatening chants,” according to the Jewish Telegraphic Agency.

In May, the UCLA chapter of SJP was ­accused by a rabbi attending a campus SSI event of “emotional and physical attacks”; a university spokesperson told the Jewish Journal at the time that “officials [were] carefully reviewing the incident.” Despite watchdog groups urging UCLA to take action, the school has since said it is permitting SJP to hold a November summit. “UCLA is bound by the First Amendment,” a school representative said. (The UCLA chapter of SJP did not reply to a request for comment.)

Ofir said she supports freedom of speech and the right to protest, but added, “There’s no difference between being anti-Israel and anti- ­Semitic [at Columbia].”

A representative for the Columbia chapter of SJP told The Post: “SJP firmly stands against discrimination in all forms, including anti-Semitism.” He did not address Ofir’s ­specific complaints.

Last week, Ofir met with Goldberg. The student requested protection from SJP and pleaded for disciplinary action to be taken against the group. Ofir said Goldberg refused and recommended that she put the school’s public-safety number on speed dial. (A school representative declined to comment on this.)

“[She] said that unless SJP gets ­violent, they can’t do anything,” said Ofir, who lives with her father in his official Upper East Side residence. “We have to wait until we’re beaten to call you? [The school] can protect me, but they choose not to.”

She stressed however, that this won’t drive her into seclusion: “You can’t make a difference if you hide who you are.”