An official statement said the children, who had written freedom slogans on walls inspired by the uprisings in Tunisia and Egypt, would be released immediately.

The statement is a rare case of Syria’s ruling hierarchy responding to popular pressure. The country of 20 million has been ruled by the Baath Party since it took power in a 1963 coup and imposed emergency law still in force.

Security forces opened fire on Friday on civilians taking part in a peaceful protest in the southern city of Daraa demanding the release of the children, all under 16, as well as political freedoms and an end to corruption. Four were killed.

On Saturday thousands of mourners called for “revolution” at the funeral of two of the protesters, in the boldest challenge to Syria’s rulers since uprisings began sweeping the Arab world.

Nonviolent protests have challenged the Baath’s authority this month, following the uprisings that toppled the autocratic leaders of Egypt and Tunisia, with the largest protests in Daraa drawing thousands of people.