Prime Minister Aleksandar Vucic had just laid a flower at a monument for the thousands of victims identified and buried there when the crowd started chanting 'Allahu Akbar' (God is Great) and throwing stones, forcing the Serbian leader to run for cover shielded by his bodyguards.
Serbia's Tanjug state-run news agency said Vucic was hit on the head by a stone and had his glasses broken.
Shortly before arriving, Vucic condemned the "monstrous crime" in Srebrenica, where some 8,000 Muslim men and boys were murdered by Bosnian Serb forces who captured Srebrenica in July 1995, near the end of the war.
Serbia quickly reacted to the incident, calling the stone-throwing in neighbouring Bosnia an attack against the country.
More From This Section
"It is an attack not only against Vucic but against all of Serbia and its policy of peace and regional cooperation," Foreign Minister Ivica Dacic said in a statement.
In 1995 Srebrenica was supposedly a UN-protected "safe haven" but the Bosnian Serb forces led by Ratko Mladic brushed aside the lightly armed Dutch UN peacekeepers.
The slaughter was followed a few months later by the Dayton peace deal, brokered by the Clinton administration, which ended the 1992-1995 conflict which cost the lives of an estimated 100,000 people.