Germany's biggest city, described by one sociologist as "the world capital of atheism," got a wake-up call in 2005 with an "honour killing" of a woman from the country's Turkish community by her brother.
Shocked by how such a crime could occur in the capital of a country that aspires to be a modern, multicultural success story, its left-wing city hall decided that schoolchildren needed a lesson in ethics.
The idea was to foster common values in schools in a city where over 40 percent of children come from immigrant families, most of them Muslims, and nip dangerous radicalism in the bud.
Germany, which opposed the 2003 US-led invasion of Iraq but has around 3,700 troops in Afghanistan under NATO command, has managed to escape terror attacks by Islamic radicals but authorities say there is still a serious threat.
Following the honour killing of Hatun Surucu, the city introduced ethics classes in 2006-7 that all secondary school students - from whatever background - in Berlin have to attend.
But now, many people are angry and that rage led to 265,000 people signing a petition which forced Sunday's referendum organised by a group called Pro Reli.
The group wants children to be able to opt out of ethics and take religion classes instead.
This is the case in most of the rest of Germany. Pro Reli - "Reli" being the nickname among German kids for religion classes - says that the whole idea behind the compulsory ethics classes is wrong-headed.
Learning more about Islam, not less - and openly, not behind closed doors - will help stop young Muslims turning into radicals, Pro Reli claims.
Leaders from other religious groups say children must be steeped in teachings from their own faith in order to understand the beliefs of others.
Supporters of the compulsory ethics classes counter that allowing children to choose between either ethics or religion lessons would split classes up and mean less integration, not more.
And they say that hot-button issues such as abortion, women's rights and sexuality should be aired in a secular forum where all sides can be considered.
"Particularly when it comes to fostering values, children should not be separated on religious grounds and classes split," according to a leaflet from the city's ruling Social Democrats.
This "would be bad for integration in Berlin and bad for the education of our children," it says.
The campaign has seen billboards plastered up all over Berlin - many of which have been vandalised - and it has drawn in celebrities from the worlds of politics, sport and entertainment on both sides of a lively and sometimes heated debate.
According to a recent survey, a wafer-thin majority - 51 percent - of people support a "yes" vote in Pro Reli's favour, but high turnout is key for the result to carry.
Polls were due to close at 6:00 pm (1600 GMT) with preliminary results expected around two hours later.