A flag displaying two swastikas and a Star of David appeared on top of a building on the New York University campus on Wednesday, the Police Department confirmed on Thursday.

The flag, which appeared near Washington Square Park, resembled the many purple N.Y.U. flags flying on campus buildings but was emblazoned with two swastikas surrounding a Star of David. According to the student newspaper, Washington Square News, the flag appeared about 5 p.m. and was removed roughly 15 minutes later.

The Police Department received a 911 call at 5:21 p.m. reporting harassment. When officers arrived, a man told them that a flag had been tampered with to display swastikas. An investigation remains ongoing, a Police Department spokeswoman said, and no arrests have been made.

“We are shocked and deeply troubled that this hateful symbol expressing antisemitism was raised on a flagpole overlooking Washington Square Park,” Wiley Norvell, an N.Y.U. spokesman, said in a statement. “Campus safety responded immediately to remove it, and we are working closely with the N.Y.P.D. to identify whoever is responsible.”

The flag appeared during a graduation week event known as Grad Alley, a block party where soon-to-be graduates and their families take in live music, dance performances and play carnival games. During the event, some people noticed the flag waving on top of the Steinhardt School of Culture, Education and Human Development, on a corner overlooking the park, according to the student newspaper.

The Steinhardt School was named for Michael and Judy Steinhardt after they donated $10 million to N.Y.U. to support “faculty development, doctoral fellowships and research.”

Mr. Steinhardt, a billionaire, made his money on Wall Street before becoming a major donor to N.Y.U. as well as to Jewish philanthropies. The Brooklyn Botanic Garden includes a Steinhardt conservatory, and the Steinhardt Gallery at the Metropolitan Museum of Art is also named for him.

Mr. Steinhardt is one of the founders of Birthright Israel, which sends young Jewish people on free trips to Israel to bolster their connection to the country and support their Jewish identity.

The incident during the Grad Alley event followed objections to N.Y.U.’s choice of a commencement speaker. Student government leaders objected to Jonathan Haidt, a social psychologist and author, being selected to speak at the graduation ceremony and sent a letter to university officials asking them to reconsider their choice. The student leaders cited Dr. Haidt’s criticism of diversity, equity and inclusion efforts.

Adina Fridman, the student president of N.Y.U.’s Hillel chapter, a Jewish student organization, said in a statement that she appreciated the university’s swift response in removing the flag on Wednesday.

“There is a clear difference between political expression and invoking Nazi symbolism to portray Israel or Jews as equivalent to the perpetrators of the Holocaust,” Ms. Fridman said. “That comparison is deeply offensive, historically distorted and antisemitic, and symbols tied to the genocide of millions of Jews have no place on our campus.”

At N.Y.U.’s commencement ceremony at Yankee Stadium on Thursday, Delissia Jeffrey, 21, who was graduating with a degree in psychology and medical humanities, wore a stole representing her home country, Jamaica. She said that she had seen the flag with the swastikas when it was briefly flying on Wednesday.

“I think it’s disgusting,” she said. “We need to stop with the separation of everyone. We should all just be glad that we can go here and have that opportunity.”

Sharon Otterman contributed reporting.