Edén was born in Piteå, in Norrbotten, son of a school principal, and graduated from secondary school in Luleå before matriculating at Uppsala University in 1889. He completed his Ph.D. in 1899 and was made docent in history at the university the same year. He was a specialist in Swedish 16th and 17th century history, but also published on topics concerning the union of Sweden and Norway. His dissertation, Om centralregeringens organisation under den äldre Vasatiden 1523-1594, was awarded the Geijer Prize.
In Uppsala
Nils Edén became lecturer of history at Uppsala University in 1899, extraordinary professor in 1903 and ordinary professor in 1909. He retained his chair until 1920, when he became governor of Stockholm county. In the meantime he was active as a liberal politician, having written on the burning issue of the union with Norway as early as the 1890s, arguing among Uppsala students for the system of compulsory military service that was introduced with the abolishment of the allotment system in 1901, and for universal suffrage, an issue that were in his mind and in the political rhetoric of the time connected to that of compulsory military service.
In the Riksdag
In 1908, Edén was elected a member of the Second Chamber of the Swedish parliament. He became a member of the parliamentary constitution committee in 1911. In 1912, when the liberal Karl Staaff became prime minister, Edén was made chairman of the liberal group in the Second chamber. After Staaff's death in 1915, Edén emerged as the leader of the liberals. He belonged to the liberal right wing which stood close to the right on defense issues and did not share the view of the many liberals from the temperance and free church movements, whose main representative was Carl Gustaf Ekman.
Edén led the Liberals to heavy gains in the election of 1917. Between them, the Liberals and Social Democrats held a clear majority in the Second Chamber. Nonetheless, King Gustaf V invited the liberal-conservative Johan Widén to form a government. However, the conservatives were unable to line up enough support to form a government. It was now clear that a king could no longer appoint a government dependent solely on him, nor could he keep it in office against the will of the Riksdag. With no choice but to appoint a Liberal as prime minister, Gustaf invited Edén to form a government. He formed a coalition with the Social Democrats, led by Hjalmar Branting who became minister for finance. The Edén government promptly arrogated most of the king's executive powers to itself. While the Instrument of Government stated that "the King alone shall govern the realm," it was now understood that Gustaf was required to exercise his powers through the ministers and act on their advice. In turn, the ministers were now both politically and legally responsible to the Riksdag. This marked the definitive establishment of parliamentary government in Sweden, though it would not be formally codified until 1974. The Edén government finally managed to get a parliamentary majority for universal suffrage. The fear of a revolutionary development in Sweden, under the impression of the events in Russia, post-World War I Germany and elsewhere, created a pressure for further democratization and through a first voting in the parliament, universal suffrage was introduced in 1921. The Edén cabinet resigned in 1920, after the issue of joining the League of Nations had been resolved.
County Governor
Edén was appointed Governor of Stockholm County which he remained until 1938, but continued as a member of the parliament. His objections against the prohibitionist policies of the majority of the party caused him and about a third of the members of liberal group in the parliament to leave the party and create a new party in 1923.