Some of Andrew Barton's trading voyages to Flanders ports in the 1490s are recorded in the Ledger of Andrew Halyburton. He was the oldest of three brothers, a younger brother Robert Barton of Over Barnton became Lord High Treasurer of Scotland.
Andrew became notorious in England and Portugal as a 'pirate', though as a seaman who operated under the aegis of a letter of marque on behalf of the Scottish crown, he may be described as a privateer. The letter of marque against Portuguese shipping was originally granted to his father John Barton by James III of Scotland before 1485. John's ships had been attacked by Portuguese vessels when he was trading at Sluis in Flanders.
James IV revived the letters in July 1507. When Andrew Barton, sailing in the Lion tried to take reprisals against Portuguese ships in 1508, he was detained by Dutch authorities at Veere. James IV had to write to Maximilian, the Holy Roman Emperor, and others to get him released in 1509. Andrew then took a Portuguese ship which carried an English cargo, leading to more difficulties, and James IV had to suspend the letter of marque for a year. Andrew captured a ship of Antwerp in 1509, the Fasterinsevin (the Shrove Tuesday), which did not come within his letter of marque. James IV ordered him to recompense the captain Peter Lempson and his officers for her cargo of woad and canvas.
The Bartons were in demand to support John, King of Denmark, and were allowed by him to harass the shipping of Lübeck. In return for this service, John of Denmark sent James IV timber for the masts of his ships from Flensburg. Andrew joined John's service briefly in the spring of 1511, but sailed away without permission, also taking a ship that James IV had given to John.
Later in 1511, Andrew Barton was cruising the English coast looking for Portuguese prizes when he and his ships the Lion and Jenny Pirwyn were captured after a fierce battle with Sir Edward Howard and his brother Thomas Howard, 3rd Duke of Norfolk, off Kent at the Downs. According to the story told in ballads, Andrew was shot and killed by an English archer during the battle and subsequently beheaded, his head being taken to the English king as evidence of his death. If true, such action would perhaps have been illegal because Barton possessed a letter of marque. Contemporary English and Scottish chronicle accounts agree that Andrew died of wounds received in the fight.
The incident was recalled two years later in the exchange of rhetoric at the battle of Flodden. The story of the sea-battle was told by Raphael Holinshed and in other 16th-century English chronicles. In Holinshed's story the Howards at first pretended only to approach and salute Andrew Barton, but then engaged in battle, Barton's ship was the Unicorn and he died from his wounds. The Scottish survivors were taken to London and kept prisoner in the Bishop of York's lodging, York Place at Whitehall. Edward Hall wrote that Andrew encouraged his men during the fight with his whistle. Hall mentions that the two ships were brought to Blackwall on 2 August 1511, and the prisoners were freed after an interview with the Bishop of Winchester, after acknowledging their piracy.
The Scottish bishop John Lesley gave a similar account of the battle in his chronicle. George Buchanan has the detail that Andrew Barton continued fighting after his leg was broken by a gunshot, and encouraged his sailors by beating a drum before he died from his wounds. Buchanan emphasises that the Howards sailed on the instruction of Henry VIII following a representation by a Portuguese ambassador. Hall wrote that Henry VIII was at Leicester when he ordered the Howards to chase the Scottish ships.
He is the subject of an English folk song entitled Sir Andrew Barton or Andrew Bartin, which is Child ballad number 167.
The most famous lines of this ballad are:
'I am hurt but I am not slain.
I'll lay me down and bleed awhile,
Then I'll rise and fight again.'
His story is also told in a Scottish Child ballad called Henry Martyn (Child ballad number 250). Rudyard Kipling wrote a short story connected with Barton in his Puck of Pook's Hill series.
The Stedman family of which there have been a number of notable members, such as Charles Stedman (1753–1812) and John Gabriel Stedman (1744–1797) have a tradition that Andrew Barton left an only son, Charles, who married Susan Stedman of Leith and took his wife's name. Another notable member was John Andrew Stedman (1778–1833) who was general in the Dutch army during the Napoleonic Wars (his father was a naturalised Dutchman who had been in the Scots Brigade in the service of the States-General of the Netherlands). His son Charles John William Stedman became a Prussian subject, settling at Besselich Abbey, near Coblentz. He was a member of the national assemblies of Frankfurt am Main and Erfurt, and received the title of freiherr (baron). He had a large family, of which nearly all the sons entered the Queen Augusta Regiment of Guards; they reverted to the original family name of Barton.