The son of Robert the Bruce, David was an infant when his father died in 1329, and a regency was created to rule the country while he was underage. Edward III of England saw the opportunity to relaunch English claims in Scotland. He sent Edward Balliol, son of the unfortunate John Balliol, north to claim the throne. David's regents sent him to safety in France while Scottish nobles like Andrew Murray, John Randolph, and Robert the Steward tried to counter the English threat.

This was more easily said than done and it took 11 long years of fighting before it was deemed safe for David to return from exile. He did his best to repair the damages of war, restore law and order, and rebuild towns that had been burned during the struggles.

While David was busy restoring order, Edward III launched an attack on France. In 1346 the French called for help against the English and David responded by raising an army and marching south towards London, thinking he could take the city while Edward was busy in France. But David was no military strategist; he met an English army at Neville's Cross, near Durham, and the Scots suffered a terrible defeat. David was taken captive and imprisoned in the Tower of London.

In David's absence, Robert the Steward (Stewart, or Stuart) ruled Scotland as Guardian. Steward had no better luck than King David, as Balliol raised a fresh army and took back all his lands.

In 1352 Edward III needed fresh funds to launch a new attack on France. He agreed to ransom David II if the Scots would swear to accept him as king if David had no heir. The Scots lords refused to acknowledge Edward. However, John Balliol offered Edward a new pretext to keep the crown; Balliol, impoverished by his long struggle to reclaim his estates, gave up his claim to kingship and handed his crown to Edward.

Edward raised a fresh army and marched north to take Scotland by force. But the Scots burned their own lands and destroyed crops ahead of Edward's army, giving him nothing to seize for his army. Edward did manage to take Edinburgh but was forced to retreat to England after his supply ships were wrecked by storms.

Robert the Steward finally agreed to ransom David II by paying a huge amount each year for 10 years. David finally returned to Scotland in 1357. He ruled for another 14 years before his death in 1371.