She was built at Leith around 1505 by order of King James IV of Scotland, as part of his policy of building a strong Scottish navy.
Records of shipbuilding between 1502 and June 1506 appear to refer to her construction; two French master shipwrights John Lorans and Jennen Diew were among the workforce.
James IV held a banquet aboard the partly built vessel on 25 May 1505, bringing tapestry and silverware from Holyrood Palace.
The ship had a blue banner with the white saltire, and a yellow flag with the red lion of Scotland embroidered in gold and silk by a Flemishman called Nannik (Nanynek Dierxsoun).
The English ambassador, Nicholas West described her preparation on 13 April 1513;On Monday, I went to the New Haven, and ther lyeth the Margaret, a ship nighe of the burden of the Cryst of Lynn, and many men workying upon her, som setting on her mayn top, and som caulking her above water, for under water she was new tallowed.