JALALABAD, Afghanistan — A suicide bomber struck a crowd of Afghan Sikhs and Hindus arriving to meet with President Ashraf Ghani on Sunday as he visited the eastern city of Jalalabad, an attack that killed at least 19 people and wounded 10 others, officials said.

The explosion occurred well outside the compound where Mr. Ghani was holding meetings. He was not harmed, and continued with his schedule as normal, officials said.

The attack claimed the life of the only Sikh candidate running in elections in the country this year, a further blow to Afghanistan’s once celebrated diversity, which has been badly affected by decades of violence.

The suicide bombing was the second deadly attack in 24 hours in the province surrounding Jalalabad, known as Nangarhar, where the Islamic State has a foothold and has repeatedly claimed responsibility for urban suicide bombings. Late on Saturday, militants targeted a boys’ school in Khogyani district, beheading three workers and setting fire to the school building.