A New York University student has been arrested for raising a flag with two swastikas and a star of David atop a school building during a graduation week event, police said Wednesday.

Alexander Stepnowsky, 23, is charged with criminal trespass as a hate crime, as well as aggravated harassment and burglary charges. He is accused of raising the flag on top of the W. 4th St. building near Greene St. in Greenwich Village on about 5 p.m. May 13.

The flag, apparently modeled on the flag of Israel, included two swastikas, the NYU logo and the Star of David, appeared after 5 p.m., police said. The building was identified by the student newspaper Washington Square News as the Steinhardt building, which houses NYU’s education programs and is named after Jewish philanthropists Michael and Judy Steinhardt.

NYU filed a harassment complaint as a hate crime, NYPD officials said.

Cops arrested Stepnowsky on Tuesday afternoon after building surveillance footage showed him in the building and on the roof when the flag was raised, according to a criminal complaint. He used his NYU access card to move through the building, cops learned.

When questioned, he admitted to constructing the flag and raising it because students were concerned over NYU’s policies involving Israel, a source with knowledge of the case said.

None of the charges were bail eligible and he was released after a brief arraignment in Manhattan Criminal Court late Tuesday.

NYU said they were grateful for the NYPD’s “exhaustive work and for the efforts of the Manhattan District Attorney in identifying the person responsible for this heinous crime.”

“The symbols that were represented are antisemitic and hateful to every person of conscience; this appalling act violated our sense of community and solidarity,” Wiley Norvell, NYU senior vice president for university relations and public affairs said. “In addition to criminal proceedings, we will immediately pursue our disciplinary procedures, which carry the most severe consequences.”

Stepnowsky was in his fourth year at NYU at the time of the incident. He is a resident of Fairfield, Conn., and has no prior arrests, cops said.

Michael Steinhardt is the co-founder of Birthright Israel, which sends Jewish college students on free trips to Israel. The trips have increasingly become a target for pro-Palestinian protests.

Financier and philanthropist Michael Steinhardt attends the Champions of Jewish Values International Awards Gala at the Marriott Marquis on Thursday, May 5, 2016, in New York. (Photo by Evan Agostini/Invision/AP)Financier and philanthropist Michael Steinhardt in 2016. (Photo by Evan Agostini/Invision/AP)

The student newspaper reported that hundreds of graduates and their friends and family were on the scene for NYU’s annual “Grad Alley” event, an outdoor street fair around Washington Square the day before commencement with food, school merchandise, games and live music.

Elected officials condemned the antisemitic flag and demanded accountability.

“Vandalizing a flag with a Nazi symbol that represents the genocide of millions of Jews is an abhorrent act of antisemitism,” Gov. Hochul said in a statement. “Graduation should be a time of celebration, not hate and division. These disgusting attacks will never be tolerated by New York State.”