Twenty-nine soldiers were killed in western Niger in an attack by suspected jihadists, the defence ministry said on Monday night, declaring a three-day national mourning period.