The earliest written record of the people is a treaty with the Romans from 354 BC, which set their border at the Liris River. Shortly thereafter, the Samnite Wars broke out; they won an important battle against the Roman army in 321 BC, and their "imperium" reached its peak in 316 BC, after further gains from the Romans. By 290 BC, the Romans were able to break the Samnites' power after some hard-fought battles. The Samnites were one of the Italian peoples that allied with King Pyrrhus of Epirus during the Pyrrhic War. After Pyrrhus left for Sicily, the Romans invaded Samnium and were crushed at the Battle of the Cranita hills, but after the defeat of Pyrrhus, the Samnites could not resist on their own and surrendered to Rome. Some of them joined and aided Hannibal during the Second Punic War, but most stayed loyal to Rome. The Samnites and several other Italic people rebelled against Rome and started the Social War, after Romans refused to grant them Roman citizenship. The war lasted almost four years, and resulted in a Roman victory. However, Samnites and other Italic tribes were granted Roman citizenship, to avoid another war. The Samnites supported the Populares in the civil war against Lucius Cornelius Sulla, but unfortunately for them, Sulla ended up winning the war and was declared the dictator of Rome. Sulla ordered all those who went against him to be punished. Thousands of people in Rome and all over Italy were brutally hunted down and killed. Samnites, who were some of the most prominent supporters of the Populares, were punished so severely that it was recorded, "some of their cities have now dwindled into villages, some indeed being entirely deserted." The Samnites did not play any prominent role in history after this, and they eventually became Latinized and assimilated into the Roman world.