James IV (b. March 17, 1473--d. Sept. 9, 1513, near Branxton, Northumberland, Eng.), king of Scotland from 1488 to 1513. An energetic and popular ruler, he unified Scotland under royal control, strengthened royal finances, and improved Scotland's position in European politics.
James IV (1488-1513) James IV, born on 17 March 1473, was 15 when his father's enemies forced him to ride with them to the Battle of Sauchieburn, and for the rest of his life he wore an iron belt as a penance. For the first time in a century, Scotland had a king who was able to start ruling for himself at once for, as Erasmus once commented, 'He had wonderful powers of mind, an astonishing knowledge of everything, an unconquerable magnanimity and the most abundant generosity.' He spoke Latin (at that time the international language ), French, German, Flemish, Italian, Spanish and some Gaelic, and took an active interest in literature, science and the law, even trying his hand at dentistry and minor surgery.
Under James' vigorous rule, he extended royal administration to the west and north - by 1493, he had overcome the last independent lord of the Isles.
Although his reign was internally peaceful, it was disturbed by wars with England. Breaking a truce with England in 1495, James prepared an invasion in support of Perkin Warbeck, a pretender to the English throne. The war was confined to a few border forays, and a seven-year peace was negotiated in December 1497, though border raids continued. Relations between England and Scotland were further stabilized in 1503, when James married Margaret Tudor, the eldest daughter of the English king Henry VII; this match resulted, a century later, in the accession of James's great-grandson, the Stuart monarch James VI of Scotland, to the English throne as King James I.
True to the ideal of the Renaissance prince, James strove to make his court a center of refinement and learning. He patronized literature, licensed Scotland's first printers, and improved education. His career is recounted in R.L. Mackie's King James IV of Scotland (1958).
With his patronage the printing press came to Scotland, and the Royal College of Surgeons in Edinburgh, St Leonard's College, St Andrews an d King's College, Aberdeen were founded. He commissioned building work at the royal residences of Linlithgow Palace, Edinburgh Castle and Stirling Castle, and developed a strong navy led by his flagship, the Great Michael, said to be the largest vessel of the time.
Events leading to Flodden Field
To begin with, relations with England were difficult: in 1495, James supported the pretender Perkin Warbeck in his claim to the English throne. Even so, he was anxious to maintain peace with England and concluded a peace treaty in 1502.
James IV's growing prestige enabled him to negotiate as an equal with the rulers of continental Europe, but his position was weakened as he came into conflict with King Henry VIII of England (ruled 1509-47). In 1512 James allied with France against England and the major continental powers. When Henry invaded France in 1513, James decided, against the counsel of his advisers, to aid his ally by advancing into England. He captured four castles in northern England in August 1513, but his army was disastrously defeated at the Battle of Flodden, near Branxton, on Sept. 9, 1513. The King was killed while fighting on foot, and most of his nobles perished. James left one legitimate child, his successor, James V.
James IV (1473-1513), king of Scotland (1488-1513), who unified the country under his rule and, in spirit of the Renaissance, patronized arts and learning. He was the son of King James III. Within a few months after his accession he ended the revolt by Scottish nobles that had cost hisfather his life. James expanded the Scottish navy, encouraged commerce,and reformed the administration of criminal justice. His romantic disposition induced him to support Perkin Warbeck, a claimant to the English throne, and to invade England in behalf of Warbeck in 1495. Two years later, however, a 7-year truce was concluded between Scotland and England. In 1503 James married Margaret Tudor, the eldest daughter of King Henry VII of England. This marriage eventually led to the union of the crowns of England and Scotland. After 1509, when Henry VIII became king of England, relations between the two countries became strained. Scotland was a traditional ally of France, and during Anglo-French hostilities in 1513 James invaded England in aid of his ally. Despite initial successes, he was plagued by desertions from his army, which was defeated at the Battle of Flodden on September 9, 1513. James himself was killed. He was succeeded by his son, James V. 
Crowned King of Scotland on 26 June 1488 in Scone Abbey, Scone, Perthshire, Scotland.
James IV was married to Margaret Tudor, daughter of King Henry of England. 6 children were born to this union, 4 sons and 2 stillborn daughters. Only one son, James V, survived into adulthood.
ILLEGITIMATE CHILDREN OF JAMES IV:
James IV also had 8 illegitimate children with four different mistresses, Margaret Boyd (also listed as Marion), Margaret Drummond, Janet Kennedy, and Isabel Stewart, daughter of James Stewart, 1st Earl of Buchan.
Alexander Stewart (c. 1493 – 9 September 1513), by Marion Boyd.
Catherine Stewart, only full sibling of Alexander
and 3 more evidently
King James Stewart was killed in Action during the War of the League of Cambrai at the Battle of Flodden Field.
James IV fought in the Battle of Flodden 9 Sep 1513 at Flodden Field, Braxton, Northumberland. As a result of injuries sustained, he died.
It may be possible to confirm family relationships with James by comparing test results with other carriers of his Y-chromosome or his mother's mitochondrial DNA.
Y-chromosome DNA test-takers in his direct paternal line on WikiTree: