Answer
James IV of Scotland succeeded his father James III as king in 1488. James III had been killed in a battle with rebellious nobles. James IV was only 17 years old when he became king, but he was a strong and capable ruler. He ruled Scotland for 24 years, and during his reign the country enjoyed a period of peace and prosperity.