An Israeli security officer stands guard during a march marking Jerusalem Day, the anniversary of Israel's capture of East Jerusalem during the 1967 Middle East war. (Ammar Awad/Reuters)

Thousands of Israelis marched through the alleys of Jerusalem’s Old City on Sunday in a controversial parade through the Muslim Quarter that marks Israel’s capture of the ancient walled metropolis in the 1967 war against Arab armies.

The Jerusalem Flag Parade can be a tense episode because revelers, many of them high school students from nationalist religious schools accompanied by their rabbis, wind their way through the Arab section of the city, celebrating the Jews’ return to the holy city — but also shouting abuse at the few Palestinians out on the streets.

On Sunday, Israeli police vowed there would be zero tolerance for the racist chants that marked past parades. Although the march featured some pushing and shoving, there were few arrests and no serious violence and few arrests.

Arab shopkeepers were ordered to close their stores along the route, but a few remained open.

“I am not afraid. This is my shop. This is my Jerusalem. I am not closing,” said Ahmed Dandes, a tailor who sells men’s trousers at the Damascus Gate.

An hour later, Dandes had shuttered his shop and was headed home.

Israeli police were especially anxious about the march because it took place on the eve of Ramadan, Islam’s month-long celebration of daytime fasting and nighttime feasts. It begins Monday at sunset.

Israeli media reported scattered chants against the Muslims — shouts of “Muhammad is dead!” and “Burn down the mosque!”

At one Palestinian sweets shop, youths surged forward, singing, “The people of Israel live!” while giving the Arab bakers their middle fingers.

Police swept in and pushed them away.

At another store selling lanterns to celebrate Ramadan, a Jewish parade warden not much older than the high-school marchers yelled at them to leave the Arab ­shopkeeper alone.

At the Damascus Gate, Rabbi Andrew Sacks was with fellow activists, handing out red roses to Palestinians. “This flag parade is an excuse for needless racism and provocation, and we are opposed to this,” he said.

One member of his group handed a flower to a Muslim youth who walked a few feet away and made a show of dropping it on the street.

Earlier in the day, Israel’s High Court of Justice turned down a last-minute appeal and ruled that the annual parade could take place on its scheduled route through the Muslim Quarter to the Western Wall, a site of Jewish prayer and devotion.

Jerusalem Mayor Nir Barkat said the parade should follow its traditional route, but he urged participants to be peaceful.

There were 1,200 police officers to meet an estimated 10,000 marchers and maintain order.

A police spokesman warned that attendees carrying signs or wearing clothes promoting incitement would be stopped from taking part. But hundreds of marchers could be seen wearing T-shirts that showed the destruction of the al-Aqsa Mosque and the imagined rebuilding of the Third Jewish Temple on the raised esplanade in the Old City that is holy to both religions.

As in past years, the march Jerusalem Flag March was a hot topic on radio stations throughout the morning. The question was why the parade needed to pass through the Muslim Quarter when there are alternative routes — through the Armenian, Christian or Jewish quarters to the Western Wall.

“It’s almost like spitting in the face of the Muslims,” well-known Israel Army Radio host Razi Barkai said during an interview with Nati Rom, a lawyer representing the organization behind the parade.

“It is not a provocation; it is something very moving that we do only once a year,” Rom said. “We celebrate Jerusalem, and according to the law here, Jerusalem is one city, so why can’t we celebrate that?”

“But why this route?” Barkai asked. “If the Gay Pride parade in Jerusalem was allowed to pass through [the Jewish ultra-Orthodox neighborhood of] Mea Shaarim, would you approve of it going there?”

Amir Heshen, a lawyer representing the Israeli human rights group Ir Amim, which petitioned the High Court to change the route, said celebrating a united Jerusalem was a falsehood because Jerusalem — which is about 63 percent Jewish and 37 percent Palestinian Muslim and Christian — has remained divided since Israel declared reunification 49 years ago following the Six-Day War.

Yoni Cohen, 18, was wrapped in an Israeli flag and marching in the parade for the third year. He said, “This is our city. This is our day. Jews died to be here. They should let us pass. The Arabs can go home. We don’t want to see them.”

Jerusalem Mayor Barkat said there have always been frictions in Jerusalem between the populations — and there always will be.

“When you talk about a united city, that does not mean everyone has to be the same. There are different people in the city with different interests. but we need to learn how to build bridges between them,” Barkat said.

On Sunday, Israel’s Central Bureau of Statistics released population statistics for Jerusalem. The city’s population has reached 870,000, with two-thirds Jewish and one-third Arab. More than a third of the Jews identify as ultra-Orthodox; about 1 in 5 called themselves secular. The number of Christians in Jerusalem has dwindled over the years, from 20 percent of the population in 1946 to less than 2 percent today.

Ruth Eglash contributed to this report.