Eventually , in the twenty-first year of his reign ( 1258 BC ) , Ramesses decided to make an agreement with Hattusili III , to end the conflict . Eventually , in the twenty-first year of his reign ( 1258 BCE ) , Ramesses decided to conclude an agreement with the new Hittite king at Kadesh , Hattusili III , to end the conflict .