A Palestinian gunman opened fire at a Tel Aviv restaurant early today, killing three people and wounding 31, four seriously, before he was shot dead, police said, the latest in a spiral of attacks and counterattacks by Palestinians and Israeli forces.