According to legend, in 832 A.D. Óengus II led an army of Picts and Scots into battle against the Angles, led by Æthelstan. The legend states that whilst engaged in prayer on the eve of battle, Óengus vowed that if granted victory he would appoint Saint Andrew as the Patron Saint of Scotland. On the morning of battle white clouds forming an X shape in the sky were said to have appeared. Óengus and his combined force, emboldened by this apparent divine intervention, took to the field and despite being inferior in terms of numbers were victorious.

Having interpreted the cloud phenomenon as representing the crux decussata upon which Saint Andrew was crucified, Óengus honoured his pre-battle pledge and duly appointed Saint Andrew as the Patron Saint of Scotland. The white saltire set against a celestial blue background is said to have been adopted as the design of the flag of Scotland on the basis of this legend.

By 1542, a white saltire set against a blue background was depicted as being the flag of Scotland.