On the death of his father in 1406, he was the first of a series of Scottish kings who inherited the throne as minors, throughout the fifteenth century.
The Scottish Parliament declared James to be king, and his uncle, Robert, Duke of Albany was appointed Governor, to rule on his behalf. Albany made no attempt to obtain James' release, and by the time he was 18, James was energetic, accomplished and impatient to return to his own country.
One day in 1423, looking from his window, he saw a beautiful young woman strolling in the gardens beneath, and fell in love with her. She was Lady Joan Beaufort, a close relative of the English king, Henry VI.
It was probably through Joan Beaufort's influence that the Treaty of London was agreed in December 1423, releasing James for a ransom of £40,000. The couple were married the following February and travelled north, to be crowned at Scone.
A cultivated, intelligent monarch who wrote poetry (he wrote the poem "The King's Quair"), loved music and was a fine athlete, James was also determined to restore law and order in his kingdom - he founded what was to become the Court of Session.
In so doing, his energy and his ruthlessness antagonised many of his nobles who had taken advantage of his absence to build up their own power.
The king was particularly determined to curb his rivals descended from Robert II; he arrested some and executed others (including the new Duke of Albany), and confiscated estates.
The result was that on 20 February 1437, at about midnight, he was assassinated and his queen badly injured in the Dominican Friary in Perth by his own uncle, Walter, Earl of Atholl (a son of Robert II's second marriage) and a group of resentful fellow conspirators.
James was buried nearby in the Carthusian monastery which he had founded.