The immediate cause of the First World War was the assassination of Archduke Franz Ferdinand of Austria-Hungary. This event triggered a series of diplomatic and military actions that ultimately led to the outbreak of the war.
In conclusion, while the assassination of Archduke Franz Ferdinand was the immediate cause, the system of alliances, nationalism, and militarization had already created the conditions for a large-scale conflict.