James I, King of Scots, was the youngest of three sons of King Robert III and Annabella Drummond and was probably born in late July 1394 in Dunfermline. By the time he was eight years of age both of his elder brothers were dead—Robert had died in infancy, but David Stewart, Duke of Rothesay, died under suspicious circumstances in Falkland Castle while being detained by his uncle, Robert Stewart, Duke of Albany. Although parliament exonerated Albany, fears for James's safety grew during the winter of 1405–6 and plans were made to send him to France. In February 1406, James, in the company of nobles loyal to King Robert III, clashed with those of the Earl of Douglas, forcing the prince to take temporary refuge on the Bass Rock in the Forth estuary. He remained there until mid-March, when he boarded a vessel bound for France, but English pirates captured the ship on 22 March and delivered James to Henry IV of England. A few days later, on 4 April Robert III died, and the 12 year-old uncrowned king of Scots began his 18-year detention.
James was given a good education at the English court, where he developed respect for English methods of governance and for Henry V to the extent that he served in the English army against the French during 1420–1. The Duke of Albany's son, Murdoch, held a prisoner in England following his capture in 1402, was traded for Henry Percy, Earl of Northumberland, in 1416. By the time James was ransomed in 1424, Murdoch had succeeded his father to the dukedom and the governorship of Scotland. In April 1424 James, accompanied by his wife Joan Beaufort, daughter of the Earl of Somerset, returned to Scotland. It was not altogether a popular re-entry to Scottish affairs, since James had fought on behalf of Henry V and at times against Scottish forces in France. Additionally, his £40,000 ransom meant increased taxes to cover the repayments and the detention of Scottish nobles as collateral. Despite this, James also held qualities that were admired. The contemporary Scotichronicon by Walter Bower described James as excelling at sport and appreciative of literature and music. Unlike his father and grandfather he did not take mistresses, but had many children by his consort, Queen Joan. The king had a strong desire to impose law and order on his subjects, but applied it selectively at times.
To bolster his authority and secure the position of the crown, James launched pre-emptive attacks on some of his nobles beginning in 1425 with his close relatives the Albany Stewarts. This resulted in the execution of Duke Murdoch. In 1428 James detained Alexander, Lord of the Isles, while attending a parliament in Inverness. Archibald, Earl of Douglas, was arrested in 1431, followed by George, Earl of March, in 1434. The plight of the ransom hostages held in England was ignored and the repayment money was diverted into the construction of Linlithgow Palace and other grandiose schemes.
In August 1436, James failed humiliatingly in his siege of Roxburgh Castle and then faced an ineffective attempt by Sir Robert Graham to arrest him at a general council. James was murdered at Perth on the night of 20–1 February 1437 in a failed coup by his uncle and former ally Walter Stewart, Earl of Atholl. Queen Joan, although wounded, escaped to the safety of Edinburgh Castle, where she was reunited with her son James II.