James IV (March 17, 1473 - September 9, 1513) was king of Scotland from 1488 to 1513.
He was the son of King James III of Scotland and Margaret of Denmark. When his father was murdered on June 11, 1488, the fifteen-year-old James took the throne and soon proved an effective ruler. Having fought off the aggression of King Henry VII of England, he recognized that he could not hope to gain the upper hand and so attempted to maintain peace with his neighbor by marrying Henry's daughter, Margaret Tudor, on August 8, 1503, at Holyrood Abbey, Edinburgh. The couple's first three children all died in infancy.
When war broke out between England and France, James found himself in a difficult position. The new king of England, Henry VIII, attempted to invade France in 1513, and James reacted by declaring war on England. Hoping to take advantage of Henry's absence, he led an invading army southward, only to be killed, with many of his nobles, at the disastrous Battle of Flodden Field on September 9. A body thought to be his was recovered from the battlefield and taken to London for burial.
Rumors persisted that he had survived and had gone into exile, but there has never been any evidence to support them.
James also had seven illegitimate children by four different mistresses: Two died in infancy, and a third, Alexander Stuart, died at the Battle of Flodden.