Hamas on Tuesday released another dozen hostages it had been holding for nearly two months, even as members of the Palestinian militant group engaged in a firefight with Israeli troops in northern Gaza that threatened to undermine the fragile cease-fire.