On 28 July 1914, Austria-Hungary declared war on Serbia. Within days, long-standing mobilization plans went into effect to initiate invasions or guard against them and Russia, France and Britain stood arrayed against Austria and Germany in what at the time was called the "Great War", and was later named "World War I" or "First World War." Austria thought in terms of one small limited war involving just the two countries. It did not plan a wider war such as exploded in a matter of days.
British historian John Zametica argued that Austria-Hungary was primarily responsible for starting the war, as its leaders believed that a successful war against Serbia was the only way it could remain a Great Power, solve deep internal disputes caused by Hungarian demands, and regain influence in the Balkan states. Others, most notably Prof. Christopher Clark, have argued that Austria-Hungary, confronted with a neighbor determined to incite continual unrest and ultimately acquire all of the "Serb" inhabited lands of the Monarchy (which, according to the Pan-Serb point of view included all of Croatia, Dalmatia, Bosnia, Hercegovina and some of the southern counties of the Hungary(roughly corresponding to today's Vojvodina), and whose military and government was intertwined with the irredentist terrorist group known as "The Black Hand," saw no practical alternative to the use of force in ending what amounted to subversion from Serbia directed at a large chunk of its territories. In this perspective, Austria had little choice but to credibly threaten war and force Serbian submission if it wished to remain a Great Power.
The view of the key figures in the "war party" inside the Tsarist government and many military leaders in Russia, that Germany had deliberately incited Austria-Hungary to attack Serbia in order to have a pretext for war with Russia and France, promoted by the German historian Fritz Fischer from the 1960s onwards is no longer accepted by mainstream historians. One of the key drivers of the outbreak of war were two key misperceptions that were radically at odds: The key German decision-makers convinced themselves Russia would accept an Austrian counter-strike on Serbia and weren't ready for or seeking a general European war, instead engaged in a bluff (especially because Russia had backed down in both earlier crises, in 1908, and again over Albania in October 1913); at the very same time the most important Russian decision-makers viewed any decisive Austrian response as necessarily dictated by and fomented in Berlin, and therefore proof of an active German desire for war with the Tsar's Empire.
A small group made the decisions for Austria-Hungary. They included the aged emperor Franz Joseph; his heir Franz Ferdinand; army chief of staff Franz Conrad von Hötzendorf, foreign minister Count Leopold Berchtold, minister-president Karl von Stürgkh, and finance minister Leon Bilinski—all Austrians. The key Hungarian leaders were prime minister István Tisza, minister István Burián, and advisor Lajos Thallóczy.
Austria-Hungary avoided major wars in the era between 1867 and 1914 but engaged in a number of minor military actions. The general staff maintained plans for major wars against neighboring powers, especially Italy, Serbia and Russia. The major decisions on military affairs 1867-1895 were made by Archduke Albrecht, Duke of Teschen, who was the nephew of the Emperor Franz Joseph and his leading advisor. According to historians John Keegan and Andrew Wheatcroft:
He was a firm conservative in all matters, military and civil, and took to writing pamphlets lamenting the state of the Army's morale as well as fighting a fierce rearguard action against all forms of innovation. . . Much of the Austrian failure in the First World War can be traced back to his long period of power. . . His power was that of the bureaucrat, not the fighting soldier, and his thirty years of command over the peacetime Habsburg Army made it a flabby instrument of war.
As Europe engaged in an arms race from the late 1890s forwards, Austria-Hungary lagged behind, spending the least percentage of its economic potential on its armed forces of all the Great Powers (2.6% of GDP vs. Russia's 4.5% in 1912).  Austro-Hungarian Chief of Staff von Hötzendorf's repeated urgings of "preventative war" against nearly all of Austria's adversaries at one time or another had no rational basis in the actual balance of military power.
The far more realistic and cautious Franz Ferdinand, despite his deep personal affection for von Hötzendorf, realized that the rise of Pan-Slavism could rip the Empire apart, and he had a solution called "Trialism". The Empire would be restructured three-ways instead of two, with the Slavic element given representation at the highest levels equivalent to what Austria and Hungary now had. Serbians saw this as a threat to their dream of a new state of Yugoslavia; it was a factor in motivating the Archduke's assassination in 1914. Hungarian leaders had a predominant voice in imperial circles and strongly rejected Trialism because it would liberate many of their minorities from Hungarian rule they considered oppressive. Despite postwar accounts that attempted to make of the heir to the throne a convenient villain in favor of war, in fact Franz Ferdinand, as well as the most public figure of note in favor of improved status for the South and other Slavs within the Empire, was adamantly opposed to annexing Serbia or to war in general, insisting that the Monarchy was too fragile internally for foreign adventures. Except for a few days in December 1912, the Archduke repeatedly intervened in government debates during the various Balkan crises of 1908, 1912 and 1913, before his own murder, insisting that advocates of war with Serbia—meaning above all Chief of Staff Hötzendorf—were servants of the Crown who "consciously or unconsciously worked to damage the monarchy."
Zametica argues that by 1909 war with Serbia was the main plan of the "war party" at Vienna. The long-term goal was to stop Russia from forming a Balkan league that would permanently stifle Austria's ambitions:
After Serbia's spectacular military performance in the two Balkan Wars of 1912-13, even though Vienna succeeded in forcing Serbia's army to finally withdraw from Albania in 1913, the goal of maintaining traditional sway over Serbia gave way to alarm. Serbia had quintupled in territory, enormous French loans permitted a rapid re-armament and enhancement of its military forces  and Serbian newspapers were replete with calls for incorporating Serbian-majority areas of the Habsburg Empire into a Greater Serbia. Anxiety over the long-term survival of Austria-Hungary reached a new pitch of intensity among its governing elite.
Austria made several overtures for friendlier relations with Russia after 1907. However these were undermined by espionage, propaganda, and hostile diplomacy by France. Austria decided the villain was probably Théophile Delcassé, the French ambassador to Russia. The one seeming success of this effort, a secret agreement with Russian Foreign Minister Alexander Izvolsky for Russian compliance to Austro-Hungarian annexation of Bosnia—itself predicted and assented to in numerous secret agreements between Russia and Austria after the Congress of Berlin—in return for Austrian support for Russian military control of the Turkish Straits, the Bosporus and Dardanelles, backfired spectacularly when the Russian press and nationalist politicians in the Duma pilloried Izvolsky, decrying the annexation as a 'humiliation' for Russia. Izolvsky then reversed himself, denying the secret agreement; only to be caught out when Germany ended the crisis by threatening to back up Austria should Russia attack over the Bosnian annexation—and threatening to release the secret documents that made Izvolsky's secret consent to the annexation a proven fact. The controversy destroyed Izvolsky's career, embittering him, and he became an ardent advocate of war against Austria-Hungary after Tsar Nicholas II of Russia dismissed him the following year, 1910, replacing him with Sergey Sazonov.
Although Germany and Austria knew full well they would be outnumbered in a major war with the Franco-Russian Alliance (made in 1894 and perhaps the only unambiguous alliance in the pre-war constellation, that few doubted would perform as promised), they made no effort to develop joint plans, or to familiarize themselves with the other's strength and weaknesses. After the war started they remained far apart. Austria had deceived itself by trusting Conrad's elaborate plans, not realizing how bad was the Army's morale, how inefficient and cumbersome was the reserve system, how thin were its stocks of munitions and supplies, or how badly its rail network had deteriorated with respect to Russia in recent years. Year-by-year as Germany discovered the depth of the weaknesses of Austria's military, and Vienna's inability to remedy deep defects, it was increasingly necessary for Germany to take more and more control of Austrian military operations. In the period leading up to the outbreak of war, German policy-makers, from Chancellor Theobald von Bethmann-Hollweg to the mercurial Kaiser himself had convinced themselves that Russia was unlikely to go to war to protect Serbia, rather inexplicably (though indeed Sazonov had forced the Serbs to back down in the Albania Crisis of just the year before). 
On 28 June 1914, Archduke Franz Ferdinand visited the Bosnian capital, Sarajevo. A group of six assassins (Cvjetko Popović, Gavrilo Princip, Muhamed Mehmedbašić, Nedeljko Čabrinović, Trifko Grabež, Vaso Čubrilović) from the nationalist group Mlada Bosna, supplied by the Black Hand, had gathered on the street where the Archduke's motorcade would pass. Čabrinović threw a grenade at the car, but missed. It injured some people in the next car and some bystanders, and Franz Ferdinand's convoy could carry on. The other assassins failed to act as the cars drove past them quickly. About an hour later, when Franz Ferdinand was returning from a visit at the Sarajevo Hospital, the convoy took a wrong turn into a street where Gavrilo Princip by coincidence stood. With a pistol, Princip shot and killed Franz Ferdinand and his wife Sophie. Princip attempted to take the cyanide capsule that had been supplied to him in Belgrade, but could not swallow all of it before the horrified crowd of Sarajevans attacked him (the police intervened to seize the suspect, who was on the verge of being lynched.). The initial reaction among the Austrian people was mild, almost indifferent; the Archduke wasn't particularly popular. Historian Z. A. B. Zeman notes, "the event almost failed to make any impression whatsoever. On Sunday and Monday [June 28 and 29], the crowds in Vienna listened to music and drank wine, as if nothing had happened." Almost no one understood how critical the heir to the throne was in strengthening his elderly uncle, the Emperor's, preference for peace and suspicion of wars; and over a period of days public opinion, moved by the Archduke's last words to his Czech wife, Sophie von Chotek "Sophie, Sophie, don't die, stay alive for our children!" reported widely in the press, and the authentic revelations of Franz Ferdinand's devotion to his family, took quite a different turn.
The assassination was not necessarily a great event—it was the reaction of multiple nations that turned it into one. Historian Christopher Clark compares Sarajevo with the September 11 2001 attacks in New York City. They both:
Conrad and his admirers took special pride in his elaborate war plans that were designed individually against various possible opponents, but did not take into account having to fight a two front war against Russia and Serbia simultaneously. His plans were kept secret from his own diplomatic and political leadership—he promised his secret operations would bring quick victory. Conrad assumed far more soldiers would be available, with much better training. The Austrian army had not been experienced a real war since 1866, whereas by contrast the Russian and Serbian armies had extensive up-to-date wartime experience in the previous decade. In practice, Conrad's soldiers were inferior to the enemy and his plans were riddled with flawed assumptions. His plans were based on railroad timetables from the 1870s, and ignored German warnings that Russia had much improved its own railroad capabilities. Conrad assumed the war would result in victory in six weeks. He assumed it would take Russia 30 days to mobilise its troops, and he assumed his own armies could be operational against Serbia in two weeks. When the war started, there were repeated delays, made worse when Conrad radically changed plans in the middle of mobilization. Russia did much better than expected, mobilizing two thirds of its army within 18 days, and operating 362 trains a day – compared to 153 trains a day by the Austro-Hungarian Empire. While the civilian politicians and diplomats of the Dual Monarchy were kept in the dark, the intelligence catastrophe of the Redl Affair (Austria's head of counter-intelligence having been unmasked as a Russian mole in 1913 ) ensured that Russia knew nearly every detail of the Chief of Staff's plans, as did Serbia.
German decision-makers made a decisive mistake when they came to the conclusion that Russia would not risk war to defend Serbia. Even the Kaiser Wilhelm II of Germany, always apt to swing from one view to the opposite over a matter of days, if not hours, was consistent in his belief that the assassination of the heir to Franz Joseph's throne would be seen as an outrage that must be punished. He told a naval aide on July 6 of 1914 that "he did not believe there would be any further military complications" and "the Tsar would not in this case place himself on the side of the regicides. Besides, Russian and France were not prepared for war.". German assurances of strong support for Austria's ultimatum were conditioned on a fundamental misreading of the situation and its very real risk of triggering a general European war. There has been a tendency for the past century to over-emphasize the constant cries for war within the German military and ignore equally bellicose statements and planted press articles on the part of similar figures in France and Russia, from Marshal Joffre to President Poincaré to the "war party" in St. Petersburg. Views range from the counter-revisionism of John Zametica, a supporter of and witness for war-criminal and pan-Serbian nationalist Radovan Karadzic at his trial in the Hague to a nuanced revisionist view (Christopher Clark) that highlights domination of foreign policy by pro-war factions in both Paris and St. Petersburg that concealed (both during the crisis and after the war) their deliberate encouragement of Serbia to act provocatively and expect military support.
One puzzle of the crisis was the slowness with which Austria-Hungary moved toward war with Serbia. This was directly related to the strong opposition of Hungarian Prime Minister Tisza to an invasion of Serbia, much less annexation of any of its territory. Tisza insisted on a diplomatic effort, and categorically ruled out a swift retaliatory attack. Other than the ever-belligerent Hötzendorf, Berchtold and other decision-makers were concerned to establish via the (rather leisurely) criminal investigation of the conspiracy against Franz Ferdinand that indeed elements within Serbia, deep inside its military and government, were complicit in the plot. Ironically, the audience this patient investigation of the facts was aimed at most of all, British Foreign Secretary Sir Edward Grey, never seems to have given serious consideration to the question. Grey was remarkably detached in the early days of the crisis and showed no signs of being well-informed on the intentions of either Britain's friends or its adversaries. Grey only proposed a mediation effort after Vienna had delivered its ultimatum to Serbia, and in a highly unfavorable manner. Russian diplomats had insisted to the British Foreign Office that Serbia was blameless in the assassination—rather strongly contradicted by the claim of Serbia's Ambassador in St. Petersburg, Miroslav Spalajković that Serbia had warned Vienna about the plot in advance (Spalajković had also repeatedly denied that any such organization as "The Black Hand" existed; while its chief was in fact the head of Serbia's Military Intelligence!, Dragutin Dimitrijević, known as Apis. Spalajković also told a Russian newspaper that Austrian arrests of Serb militants in Bosnia might lead Belgrade to attack the Habsburg Dual Monarchy (!) before the Austrian ultimatum had even been drafted.). Yielding to Hungarian objections and the fear of alienating reservists busy harvesting crops in the still majority-peasant Dual Monarchy, von Hötzendorf waited for the investigation to make progress. Many Army units were on harvest-leave and not scheduled to return until 25 July. To cancel those leaves would disrupt the harvest and the nation's food supply, scramble complex railroad schedules, alert Europe to Vienna's plans and give the enemy time to mobilize. Meanwhile, Emperor Franz Joseph went on his long-scheduled summer vacation.
Austria depended entirely on Germany for support – she had no other reliable ally, for though Italy was nominally a member of the Triple Alliance, earlier Balkan crises had revealed strong frictions between Italy and Austria-Hungary. Italy remained neutral in 1914 and instead joined the Allies (the Entente powers) in 1915. German Chancellor Bethmann-Hollweg had repeatedly rejected pleas from Britain and Russia to put pressure on Austria to compromise, erroneously believing the coming conflict would be contained in the Balkans. Kaiser Wilhelm II, having convinced himself that Serbia would give into Austrian demands (showing how out of touch he was by believing Serbia's acceptance of most of the ultimatum meant war would be avoided) on July 27, tried to communicate with his cousins George V of the United Kingdom and Nicholas II, but with the involvement of his Foreign Ministry. The Kaiser made a direct appeal to Emperor Franz Joseph along the same lines. By the 27 and 28 of July the secret partial mobilization that Russia had begun on 25 July was starting to become apparent to German intelligence assets, and the official line from St. Petersburg, that it was necessary to "safeguard peace by the demonstration of force" was about to collapse. Indeed, a Tsarist Russian general in 1921 looking back opined that by July 24 and 25 "the war was already a decided thing, and all the floods of telegrams between the governments of Russia and Germany were nothing but the staging for an historical drama." More traditional historiography, as well as proponents of the "Fischer School" that places German militarism as the principal motor of war state that German military had its own line of communication to the Austrian military, and insisted on rapid mobilization against Russia. There is a curious lack of examination of the actual actions of the Russian Government, first in secretly attempting a "partial mobilization" from July 24- 29, and then being the first Power to begin a true "General Mobilization" on the evening of July 29th. The next day the German Chief of Staff Moltke sent an emotional telegram to the Austrian Chief of Staff Conrad on July 30: "Austria-Hungary must be preserved, mobilize at once against Russia. Germany will mobilize.". Even as the German government and military prepared to mobilize in turn, Wilhelm II and German diplomats frantically attempted to persuade Britain to stay out of the looming general war.
When he was finally ready, Conrad on August 12 sent his army south into Serbia, where it was decisively defeated with the loss of 100,000 soldiers. On 22 August he launched an even larger campaign to the east against Russia through Galicia, leading to catastrophic defeats in the loss of 500,000 Austro-Hungarian soldiers. He blamed his railroad experts. 
Austria was not ready for a large-scale war, and never planned on joining one at its onset. Its war plans assumed a swift limited invasion of Serbia and perhaps also a “defensive” war against Russia—which it had little chance to defeat unless Germany joined in, which Berlin had promised to do.
The first round of scholarship from the 1920s to the 1950s, emphasized Austria's basic responsibility for launching the world war by its ultimatum to Serbia. In the 1960s German historian Fritz Fischer radically shifted the terms of the debate. While not denying Austria's responsibility, he shifted the primary blame to Germany, for its longtime goal of controlling most of Europe. According to Fischer, the reason for that goal was to suppress growing internal dissent inside Germany. In the 1960s and 1970s historians briefly summarized Vienna's actions. Samuel Williamson in 1983 returned to an emphasis of the centrality of Vienna's decisions. He says that Austria's policy was not timid or indicative of second-rate power pushed forward by Berlin. Austria acted like a great power making its own decisions based on its plan to dominate the Balkan region and hurl back the Serbian challenge. 
Even those who emphasize Vienna's strategic dilemma, facing activity intolerable to any sovereign state now or then ("Before World War I, Serbia financed and armed Serbs within the Austrian Empire" ) also point to Berlin's infamous "blank check" in early July that finally licensed "Austria-Hungary's mad determination to destroy Serbia in 1914"  as central to the ensuing catastrophe. Still other impressively researched studies maintain with formidable documentation that Russian and French eagerness for war (the one-time Soviet explanation) has been overly discounted, along with sheer errors made by all the principal decision-makers: “The war was a tragedy, not a crime.” (Clark's "The Sleepwalkers"). And even though some Austrian politicians embraced responsibility after the defeat ("We started the war, not the Germans, and even less the Entente" ), some contemporary historians have broken entirely with the conventional explanation of Austrian responsibility, finding that Russian and French encouragement of Serbia's provocative policies vis-à-vis Austria-Hungary were part of a knowing desire for war by Russia and its French ally (according to historian Sean McMeekin : "As indicated by their earlier mobilizations (especially Russia's) in 1914, France and Russia were far more eager to fight than was Germany — and far, far more than Austria-Hungary, if in her case we mean fighting Russia, not Serbia." ) a viewpoint buttressed by a great deal of Clark's research.
What can be said with certainty, after many decades in which the Sarajevo Assassination was treated as a trivial pretext for a cataclysm generated from all the general ills of pre-1914 European society is simply this: The one person who indisputably could have -- and would have -- prevented war with Serbia, and thus a larger European war; who could single-handedly block the Austrian "hawks" ... was killed by Gavrilo Princip's bullet on June 28, 1914.