Ann Khalid did not feel well but she insisted on dancing a brief scene from Tchaikovsky’s Swan Lake with her classmates. The 12-year-old is determined to one day have a career dancing and teaching ballet – not an easy path in a country torn for years by conflict.

“My school and my church are the two things I love the most in Baghdad,”Khalid, in her black leotard and white ballet shoes, said with pride after the dance.

If she has a shot at her dream, it’s because of the Baghdad School of Music and Ballet.

The school has managed to survive decades of turmoil, a feat that speaks to the resilience of Baghdad’s residents through war after war. The Iraqi capital’s past as a middle east center of culture is a distant memory, but the school has carved out a tiny island of creativity amid the violence that is an inescapable part of daily life and the religious conservatism that now defines it..

Students practice playing the oud in a music studio at the school. Photograph: Khalid Mohammed/AP

“Where else in Iraq can you walk into a school and listen to a small boy playing Antonio Vivaldi on his violin?” boasts the school principal, Ahmed Salim Ghani, himself a virtuoso player of the contrabass and the oud, an Arab instrument resembling the lute.

Another rarity: it isn’t segregated by gender like almost all Iraqi schools. Male and female students take classes together from kindergarten to high school.

“The second you walk through the gate, you find yourself in a different world, one of art and culture,” Ghani said.

Ghani proudly declares himself a “genuine” Baghdadi. He speaks nostalgically about Baghdad’s golden age – the 1960s through to the 1980s. Back then, the city’s elite patronized art and culture, while secular, albeit dictatorial, regimes ensured that enough of the nation’s petrodollars went to the arts. The school, founded in 1968, thrived.

The school now has around 500 students. Photograph: Khalid Mohammed/AP

Black-and-white footage of a 1977 school production of The Nutcracker shows a relatively high level of discipline, with the children dancing in professional-level costumes. In class photos from the era, the schoolgirls and female teachers wear miniskirts. The boys wear blazers and bow ties.

Things rapidly worsened for Baghdad and the school with Iraq’s 1990 invasion of Kuwait. UN sanctions devastated the economy, ruptured the nation’s social fabric and forced hundreds of thousands to leave their homes in rural areas. They descended on the city to find work, bringing with them the conservative traditions of their villages.

With state coffers emptying, Russian instructors brought to the Baghdad school were sent home.

The city plunged deeper into chaos after the 2003 US-led invasion. The school was looted days after Saddam Hussein’s ouster. Later it was partially burned during a rampage by disgruntled Saddam-era officers.

Many parents now pull their daughters out of ballet when they are 12 or 13 because they object on religious grounds to the girls being lifted and embraced by boys their age, said a ballet instructor. Photograph: Khalid Mohammed/AP

Amid the violence, religious extremism rose, nurturing the notion that ballet – and to a lesser extent music – is immoral and anti-Islamic.

The school removed its large street sign to escape attention. Children hid their musical instruments when out in public or left them at school. Some of the policemen assigned to protect the building asked for transfers, not wanting to be associated with an “immoral” institution.

Daily bombings, assassinations and kidnappings forced parents to keep their children at home. The school’s best Iraqi ballet and music teachers fled, seeking employment abroad. During the height of the violence, in the mid-2000s, the number of students plunged to an all-time low of 100-120, according to Ghani.

Security in the city has improved, but bombings continue.

“We hope it is just a phase that will eventually go away,” said Salam Arab, whose 16-year-old son Maysara is considered one of the school’s best male dancers. “It’s a rare school in the Arab world, and it is very important that it continues to carry out its mission.”

Daily bombings, assassinations and kidnappings forced parents to keep their children at home. Photograph: Khalid Mohammed/AP

The conservative religiosity that pervades Baghdad’s society has a powerful effect as well.

The school now has around 500 students. But many parents now pull their daughters out of ballet when they are 12 or 13 because they object on religious grounds to the girls being lifted and embraced by boys their age while performing, according to Zeina Akram Fayzy, a 40-year-old ballet instructor.

“Years of our hard work go to waste,” lamented Fayzy, an alumna of the school. “The school needs talented children who stay the course.”

Leezan Salam, who graduated this year, said that when she started ballet at the school, there were around 30 girls with her. By the time she reached 10th grade, “we were only three.”

Leezan Salam, an 18-year-old school teacher, right, helps her students during a dancing class . Photograph: Khalid Mohammed/AP

“The future of ballet in Iraq is dismal. No one really cares,” said Salam, 18, a lanky brunette with a dreamy voice. She now teaches children while pursuing her own dance career, hoping to perform solo.

Khalid, the 12-year-old, says the moral questions surrounding dance don’t dent her enthusiasm.

“Everyone says it is haram (religiously prohibited) and disgraceful. But my parents are happy for me to dance,” she said. She’s the daughter of artistic parents – her father is an actor and her mother a television director.

Dance can be equally problematic for boys.

Maysara said he doesn’t tell people he dances. “Those in my neighborhood who have found out often mock me,” he said.

As they did drills together, his fellow dancer Moayed Nawar interjected, “I want to dance professionally.”

Then the 13-year-old added defiantly, “I am not going to stop, stay home and shut up about it.”