BEIRUT (Reuters) - The Syrian government and rebel groups swapped dozens of women prisoners and hostages, some of them with their children, in Hama province on Tuesday evening, a monitor and a rebel official said.

The Syrian Observatory for Human Rights, a British-based war monitor, said government representatives and rebels exchanged 112 people, including 24 children, in the rebel-held Qalaat al-Madiq town in rural Hama. Many had been detained for years.

About half the women were released from government prisons and then taken to opposition-held areas, the Observatory said.

In return, the others, along with three unidentified men, were set free by various rebel groups and shuttled to government-controlled areas along the coast.

This kind of exchange was rare in the nearly six-year-old war, but had been occurring more often in recent months, the Observatory said.

The war pits President Bashar al-Assad’s government, backed by Russia and Iran, against an array of mostly Sunni rebel groups, including some backed by Turkey, the United States and Gulf monarchies.

Mohamad Rasheed, a spokesman for the Jaysh al-Nasr rebel group based in Hama, said a civilian committee that negotiates such exchanges with the government oversaw the swap on Tuesday.

The prisoners on both sides included children, he said, and “some of the women had given birth while detained”.

Most of the hostages released by rebels were from the coastal Latakia province, the heartland of Assad’s minority Alawite sect, and had been held since 2013, Rasheed said.

Some of the prisoners set free by the government had been detained since the start of the uprising in 2011, he added.

There was no immediate comment from the Syrian government.

The conflict has killed hundreds of thousands of people, made more than half of Syrians homeless and created the world’s worst refugee crisis.