A displaced girl from the minority Yazidi sect, who fled violence in the Iraqi town of Sinjar, worships at their main holy temple Lalish in Shikhan. (Ahmed Jadallah/Reuters)

For millennia, Iraq has been one of the Middle East’s most religiously and ethnically diverse lands. Its cities and villages are dotted with the decaying hallmarks of ancient Babylonian civilization, the mosques of the first Muslim empires, the castles of foreign conquerors, and the churches and shrines of early Christians and Jews.

Now that history may be coming to an end.

Iraq’s demographics have shifted over time for a variety of reasons, including violence and politics. But the rise of the Islamic State group may have dealt the most lethal blow in centuries to the nation’s diversity.

The Sunni militant fighters have driven away, enslaved and exterminated Shiites and members of Iraq’s ethnic and religious minorities on a scale that human rights groups have likened to ethnic cleansing.

The impact, experts say, goes beyond ridding Iraqi cities of their cultural diversity. The extremists’ campaign could lay the foundation for perpetual conflict by segregating and isolating the country’s religious and ethnic groups.

Iraqi Shiite Muslim pilgrims make their way through Baghdad's Sunni Adhamiya district. (Ahmad Al-Rubaye/AFP/Getty Images)

Future generations of Sunnis and Shiites may know little of each other, undermining the very idea of what it means to be Iraqi, intellectuals fear.

“The identity will change,” said Ahmed Saadawi, a well-known Iraqi novelist. “It will be distorted and incomplete.”

On a recent day, Saadawi led a reporter through a central Baghdad neighborhood, Bataween, that provided a glimpse of what it means to lose the nation’s diversity. Today, it is home to poor Shiites and Sunnis. But in the last century, it was a Jewish enclave.

“This is the old Jewish style of house,” said Saadawi, striding into the courtyard of an old stone house, its long wooden balcony slouching toward a quiet, trash-covered street.

Most Jews left Iraq after the creation of Israel in 1948. These days, most Iraqi men and women have never met a Jew. Jews are mostly associated with Israel, a country that Arabs are taught to hate.

In the wake of the Islamic State’s rise, small religious minorities such as Christians and Yazidis — a group that draws from various religious traditions — have sought refuge in Kurdish areas. Some say they hope to flee the country, never to return.

The people left behind in areas captured by the Islamic State will increasingly be “one color,” said Hamed al-Maliki, an Iraqi writer, meaning they will have the same Sunni beliefs and customs.

Iraqi Christians pray during a Sunday Mass at the St. Joseph church in Irbil. (Mohamed Messara/EPA)

Shiite communities, too, will grow more homogenous as they absorb displaced Shiites and become increasingly radicalized by the war, Maliki said.

“What I fear is that a racist wall will form,” he said.

Already the walls have formed in Baghdad.

Thousands of Sunnis fled ­Shiite-majority areas and Shiites fled Sunni-majority areas during sectarian violence in 2006 and 2007, after the U.S. invasion.

U.S. military forces, and later the Iraqi government, set up towering concrete blast walls to encircle and protect certain neighborhoods. Residents living in them often support sectarian militias.

In the past three months, such Balkanization has extended well beyond Baghdad.

Since the Islamic State jihadists swept into Mosul, there are almost no Shiites, Christians or members of small minorities — such as Yazidis or Shabak — remaining in Iraq’s second-
largest city, former residents say.

“Sunni people stayed. Shiite people left,” said Bashar Hamza, a Shiite waiter who fled Mosul with his family of five.

In late July, Islamic State militants blew up a series of ancient shrines and tombs in the city, including one that was believed to be the burial site of Jonah, the prophet who Jews, Muslims and Christians believe was swallowed by a whale.

In the west, the Yazidis have fled the mountains of Sinjar, where they had kept their religion and culture intact for centuries. Many are now seeking to migrate abroad.

The Shiites have left Tal Afar in northwestern Iraq, home to an ancient hilltop citadel — one of the first landmarks captured by the Islamic State as it overran the town in June. Tal Afar’s residents are mostly ethnic Turkmens, many of them Shiites.

In other areas of Nineveh and Salahuddin provinces, Shiite villages lie empty and burned.

“Al-Khadara and al-Jazeera neighborhoods were all Shiite, and now all the people, all of the stores, all of the life — it’s gone,” said Ahmed Ibrahim, a government employee who fled Tal Afar with his family in June.

Ibrahim still calls his Sunni neighbors to check on the house he left behind. They tell him the Shiite homes have been looted and burned, and that their shrines are being destroyed. Of the neighborhood he once lived in: “They say it is a ghost town,” Ibrahim said.

In the meantime, Sunnis have been expelled from other areas.

In Amerli, a majority Shiite farming hamlet in northern Iraq, there are no Sunnis left, after Sunni locals sided with Islamic State jihadists who besieged the town for two months, only to eventually be driven away.

Meanwhile, the Arabs have left Makhmour and other towns in Iraq’s Kurdish-majority regions; they have been pushed out in battles between the Islamic State and Kurdish fighters, known as the pesh merga. The Kurds fear the Arabs may have collaborated with the militants.

“It’s a real issue going forward — the destruction of trust. That could have lasting impact,” said Michael Knights, an Iraq expert at the Washington Institute for Near East Policy.

Even when the current conflict dies down, many who fled may not want to or be able to return home, Knights said.

Bataween offers a glimpse of a different era. In the early 20th century, it was a wealthy Jewish neighborhood. It then became a Christian area.

“There is only one mosque in Bataween, but there are a million churches and a Jewish temple,” said Saadawi, the novelist, as he meandered past piles of rubble and homes now occupied by the city’s most desperately poor. The tower of one old white church was visible at the end of the street.

Saadawi based his magical realist novel “Frankenstein in Baghdad” in the neighborhood because of the poverty, the crumbled homes and the ghosts of the past. The book’s monster — a creature composed of human body parts — comes to reside in the rubble of a collapsed house.

Iraqis have little recollection of the Jewish community that once played an important role in their national life. Most Iraqis probably don’t know that Iraq’s first finance minister was a Jew or that some of Iraq’s best singers were, as well.

Just as Saadawi recalled the one­time Jewish residents, it is possible that the Sunnis who remain in Mosul, Tal Afar and other towns across northern Iraq will someday tell visitors of the Yazidis and Shabak who graced their alleys, or of the Christians whose church performances once inspired Iraqi theater.

Or perhaps they’ll say: “That’s where the Shiites used to live.”

Mustafa Salim in Baghdad contributed to this report.