Azerbaijan's President Ilham Aliyev vowed on Saturday to strike back against Armenia after shelling on his country's second-largest city, Ganja, left at least 12 civilians dead and dozens injured. Mr Aliyev said Azerbaijan's army would retaliate against Armenia and "take revenge on the battlefield," in televised remarks hours after the shelling on a residential area in Ganja flattened rows of houses. "They will be held responsible for that ... If the international community does not punish Armenia, we will do it," he said. Azerbaijan said that 12 people were killed and more than 40 were seriously injured after a missile hit the city. The Azeri Prosecutor General's office said around 20 apartment buildings had been hit with missile strikes in the country's second-largest city and miles away from Nagorno-Karabakh. The foreign affairs ministry suggested in a post on Twitter that Armenia was responsible for the shelling. Armenia denied the claim. Armenian Defence Ministry spokeswoman Shushan Stepanyan denied they had fired any missile towards Azerbaijan. The two countries have been fighting over the disputed region of Nagorno-Karabakh since late September. The Azeri foreign affairs ministry said two minors were among the dead. A Facebook post from the country’s General Prosecutor’s Office said missiles hit a civilian settlement in the city. Both Azerbaijan and Armenia on Saturday continued to accuse each other of fresh attacks in violation of a week-old Russian-brokered ceasefire that has failed to halt the fighting in the South Caucasus. The fighting is the worst in the region since Azerbaijan and ethnic Armenian forces went to war in the 1990s over Nagorno-Karabakh, a mountain territory that is internationally recognised as part of Azerbaijan but populated and governed by ethnic Armenians. Armenia accused Azerbaijan of continued shelling of populated areas. Mr Aliyev said the Azeri army has completely taken over two regions previously held by separatists, Fizuli and Jabrail. "We are dominating the battlefield," he said, adding that Azeri armed forces never targeted civilian settlements despite civilians fleeing shelling on residential areas in the disputed region. Mr Aliyev also questioned Armenia's ability to keep replacing military hardware destroyed in battles, a thinly veiled jab at Yerevan's ally Moscow. He reiterated his stance that Baku would only stop its offensive once Armenia withdraws from Nagorno-Karabakh. In Ganja, rescuers worked at the scene on Saturday morning, picking through rubble. Some houses had been almost levelled. An excavator was clearing the debris. "We have been living in fear for days ... We are suffering a lot. We would rather die. I wish we were dead but our children would survive," one resident of the city, 58-year-old Emina Aliyeva, told reporters. Denying involvement, the Armenian defence ministry claimed Azerbaijan was continuing to shell populated areas inside Nagorno-Karabakh, including Stepanakert, the region's biggest city. Three civilians were wounded as a result of Azeri fire, the Armenian foreign ministry said. Witnesses in Stepanakert said they had heard several explosions on Friday night and in the early hours of the morning. Armenia also said several Azeri drones flew over settlements in Armenia, attacked military installations and damaged the civilian infrastructure. Armenian Prime Minister Nikol Pashinyan called attacks "an attempted genocide of the Armenian people". "We must defend ourselves, like any nation that is threatened with extermination," he told the French newspaper Liberation. Baku said on Saturday that 60 Azeri civilians had been killed and 270 wounded since the fighting flared on September 27. Azerbaijan has not disclosed military casualties. Nagorno-Karabakh says 633 of its military personnel have been killed, and 34 civilians.