<human>:  How many years did the Roman Republic last?
<bot>: The Roman Republic lasted from 509 BC to 27 BC. It was a period of time when Rome was ruled by a series of elected consuls. The Roman Republic was the first republic in the world, and it was the first to have a written constitution.