Azerbaijan said 21 people were killed when Armenian shells hit the town of Barda, northeast of Nagorno-Karabakh. Armenian-backed officials in Nagorno-Karabakh said Azeri shells had fallen on the enclave's two largest cities, killing one person.
Both sides denied each other's claims.
The worst fighting in the South Caucasus for nearly 30 years has raised fears of a wider war that could suck in Russia and Turkey, an ally of Azerbaijan. It also poses a threat to pipelines carrying oil and gas from Azerbaijan to world markets.
The International Committee of the Red Cross said it had witnessed shelling in urban areas on both sides of the front line. It said a volunteer from the Azerbaijan Red Crescent Society had been killed and two others injured in the shelling.
"These latest exchanges signal that the Nagorno-Karabakh conflict risks spiralling out of control," Martin Schuepp, the ICRC's Eurasia regional director, said in a statement. "Civilian lives are being lost at an alarming rate."
Nagorno-Karabakh is internationally recognised as part of Azerbaijan but is populated and controlled by ethnic Armenians. About 30,000 people were killed in a 1991-94 war in the region.
The prosecutor general of Azerbaijan's office said 21 people had been killed and 70 wounded in Barda.
Aisel Huseynova, a 35-year-old housewife who lives in the town, said she heard two explosions while out shopping with her son. The second blast swept her off her feet.
"When I regained consciousness, I was already in the ambulance," she said by telephone from a hospital bed. "I have a wound in the leg and arm. My son was not with me. I don't know where he is."
The Emergency and Rescue Service of ethnic Armenian-controlled Nagorno-Karabakh said shells had fallen on Stepanakert, the enclave's largest city. It said a civilian had been killed and two wounded by shelling in another city, Shushi, 15 km (nine miles) to the south.
Armenia's defence ministry also said a maternity hospital in Stepanakert had been hit. There were no reports of casualties.
Angela Frangyan, a documentary film maker currently in Stepanakert, said she heard "at least two strong bombardments".
"When I approached the hospital, I saw shattered windows and damaged ceilings at the maternity hospital, and a doctor crying," she told Reuters by telephone.
BROKEN CEASEFIRES
Armenia's defence ministry also confirmed on Wednesday that Azerbaijan had seized the strategic town of Gubadli between the enclave and the Iranian border, an apparent military gain that could make a diplomatic solution more difficult.
Azerbaijan rejects any solution that would leave Armenians in control of the enclave, which it considers to be illegally occupied. Armenia regards the territory as part of its historic homeland and says the population there needs its protection.
The Nagorno-Karabakh defence ministry has recorded 1,068 military deaths since fighting erupted on Sept. 27. Azerbaijan has not disclosed its military casualties. Russia has estimated as many as 5,000 deaths in total.
The latest of three ceasefires was brokered in Washington on Sunday. U.S. President Donald Trump called the renewed fighting "disappointing" and Secretary of State Mike Pompeo urged both sides to pursue a diplomatic solution.
The OSCE Minsk Group, formed to mediate the conflict and led by France, Russia and the United States, was due to meet the Azeri and Armenian foreign ministers in Geneva on Thursday but this has not been confirmed. Turkey has demanded a bigger role in the group.