Gunmen attacked a hospital in the Afghan capital, Kabul, on Tuesday where the international humanitarian organisation Doctors Without Borders runs a maternity clinic, officials said.