The group of thieves who dynamited the doors and safes of a jewelry factory freed nine people they had held hostage for 20 hours in southern Brazil, police said.

The attackers had hidden themselves with their hostages in a wooded area of Rio Grande do Sul state after three members of the criminal group were killed in a shootout with police.

The hostages - six women, a boy and two men - showed up safe and sound about 9:30 p.m. on Sunday at one of the police checkpoints set up in the area.

"We're with the nine safe-and-sound hostages (and they're) in good shape," state police Capt. Juliano Amaral said on Twitter.

The criminals, however, remain holed up in the wooded area, which has been surrounded by some 200 police.

The drama began about 2 a.m. Sunday when around a dozen armed men attacked a jewelry factory in the town of Cotipora.

Police pursued the attackers and, in an initial shootout, killed three of them, while two officers were wounded by gunfire.

One of the dead men was identified as Elisandro Rodrigo Falcao, the most wanted criminal in Rio Grande do Sul and the reputed head of a band that uses explosives to rob banks, armored cars and automatic teller machines.

The other members of the gang took two women hostage at a bar near the jewelry factory as well as seven members of a family living in a house in the rural part of Catipora. EFE