After the unrest at the end of the 19th Dynasty with regard to the succession, Sethnakht eventually restored order. He only ruled a few years and was succeeded by Ramesses III. He was confronted by several attacks by Libyans and by the Sea Peoples. Internal unrest was the result of an economic crisis, partly caused by the corruption and negligence of many officials. Eventually this led to very high grain prices. The state was no longer able to take care of the workers of Deir el-Medinah, and they eventually even went on strike. After the death of Ramesses III (he was probably assassinated), Ramesses IV ruled for about six years. He was followed in turn by Ramesses V, VI, VII and VIII, each of whom only ruled for a short period. Under Ramesses IX, X and XI, legal trials were held against the robbers who had been plundering the tombs in the Valley of the Kings for years. The papyri containing the proceedings of these trials not only give us an insight into the Egyptian judicial system, but also into the robbers methods and the far-reaching corruption of the officials. Civil war broke out under Ramesses XI with the temple of Medinet Habu being stormed and partly destroyed. The Viceroy of Nubia, Panehsy, was able to suppress the uprising. From that time on Ramesses XI was king in name only. The government of Upper Egypt lay in the hands of the general and High Priest of Amun, Herihor, that of Lower Egypt in the hands of Smendes. Herihor was able to drive Panehsy back to Nubia. An oracle, based in the temple of Karnak, made it clear that the gods supported the powerful position of Herihor. Upper Egypt was now the God's State of Amun. Herihor was succeeded by his son Piankh. Scholars are still debating the precise relationship between Herihor and Piankh, as well as the order of their succession.