According to tradition and later writers such as Livy, the Roman Republic was established around 509 BC, when the last of the seven kings of Rome, Tarquin the Proud, was deposed by Lucius Junius Brutus and a system based on annually elected magistrates and various representative assemblies was established. A constitution set a series of checks and balances, and a separation of powers. The most important magistrates were the two consuls, who together exercised executive authority such as "imperium", or military command. The consuls had to work with the senate, which was initially an advisory council of the ranking nobility, or patricians, but grew in size and power.