 When James III attempted to lead his army against the invasion, his army rebelled against him and he was briefly imprisoned by his own councillors in the first major crisis of his reign.James IV's mother, Margaret of Denmark, was apparently more popular than his father, and though somewhat estranged from her husband she was given responsibility for raising their sons at Stirling Castle, but she died in 1486.Two years later, a second rebellion broke out, where the rebels set up the 15-year-old Prince James as their nominal leader.