Born the eldest son of James III of Scotland and his wife, Margaret, princess of Denmark, James IV came to the throne at the age of 15, in succession to his father, who was murdered in the course of a rebellion by Scots nobles.
The younger James felt responsibility for his father's death, given that he had been the rebels' figurehead -- thereafter, throughout his life, he is said to have worn an iron chain round his waist, adding a weight to it each year on the anniversary.
Under James IV Scotland was driven forward into an age of progress. A navy was founded, printing introduced, a third university founded, and the science of architecture was developed. James himself was said to be fluent in no less than five languages, without including the Scots Gaelic of most of his people, not to mention possessing the skill (or art) of dentistry, at a level which allowed him to charge for his services.
James suppressed the most violent among his nobility, notably the MacDonalds, from whom he removed the Lordship of the Isles, as well as parts of their lands. He also sought to regularise relations with Scotland's oldest foe, England. The Tudors had just seized the throne there, but James was persuaded that the pretender Perkin Warbeck was the true monarch, and supported him until Warbecks's death, although not with military force. Thereafter the two nations agreed a 7-year truce from hostilities, and negotiations were opened for a longer peace. In this regard, after the mysterious death, by poison, of his mistress Margaret Drummond (together with both her sisters), James became betrothed to, and finally married, Margaret, daughter of England's king Henry VII. He was 28; she was 12. A declaration of lasting peace was made which lasted for all of 10 years until England went to war with France, who had a pre-existing treaty with Scotland which required James to support them. [It was this marriage, Tudor to Stewart, that, on the death of Elizabeth I, led to the accession, to the English throne, of James VI of Scotland as James I of England.]
The English countered by attacking Scottish shipping and, regretfully, James felt compelled to launch an invasion, and at Flodden on September 9, 1513 James was killed in battle. His infant son, James V, succeeded him.
This page was based on a variety of on-line sources.