 James was the third son of King James IV of Scotland and his wife Margaret Tudor, a daughter of Henry VII of England and sister of Henry VIII, and was the only legitimate child of James IV to survive infancy.He was born on 10 April 1512 at Linlithgow Palace, Linlithgowshire, and baptized the following day, receiving the titles Duke of Rothesay and Prince and Great Steward of Scotland.He became king at just seventeen months old when his father was killed at the Battle of Flodden on 9 September 1513.