Masked gunmen opened fire at Iraqi protesters in the Shia holy city of Karbala on Tuesday, killing 18 people and wounding hundreds, security officials said, in one of the deadliest single attacks on protesters since anti-government demonstrations erupted earlier this month.