Iraqi security officials say unidentified gunmen have shot and killed the imam of a Sunni mosque and three other people in Baghdad .