Mauritanian officials say unknown gunmen have killed at least three government soldiers in an attack on a military post .