As a result of the Balkans wars Serbia had become a significant power in the region. Serbia still had intentions to incorporate Bosnia-Herzegovina into its territory. There were a lot of Serbs living in the region and a lot of anti-Austrian feelings. Russia was also using the friction in this area to further its own objectives in the region and covertly supported Serbian dissident factions.
Austria recognised this threat and knew that Russia would declare war if they attacked Serbia. To offset the threat they relied on their alliance with Germany. Any aggressive action against Serbia by Austria would be dependent on German support.
In 1914 the heir to the Austrian-Hungarian throne, Archduke Franz Ferdinand, as inspector of the army, was invited to review the occupying troops on maneuvers in Bosnia-Herzegovina. The visit was to take place in Sarajevo just across the border from Serbia.
During the visit both the Archduke and his wife Sophie were assassinated by Gavrilo Princip a member of the Serbian Black Hand group. It was known that the Black Hand group were supported by members of the Serbian intelligence community and on the 23rd July, 1914 the Austrian-Hungarian government issued a demand known as the July Ultimatum that Serbia:
After receiving reassurances from Russia that it would honour its promise of support the Serbian government mobilised its army and replied on the 25th July that they would be unable to comply with some of these demands as they violated Serbian law.
On 28th July 1914, with the full support of Germany, Austria-Hungary declared war on Serbia leading to the outbreak of the First World War.
It gave Austria-Hungary the opportunity to make demands of Serbia that they could not fulfill, which gave them reason to declare war on Serbia.