It's believed that around 60 AD St. Andrew, who became the Patron Saint of Scotland, (and who was one of Jesus' Apostles - the younger brother of Simon Peter) was crucified. Legend says that he felt himself unworthy of being crucified on a cross that resembled the one Jesus died on, and so he hung on a saltire, or diagonal cross.
There's also a second theory about this detail, as some historians believe that St. Andrew was crucified by the Romans in Greece, where this diagonal cross was more commonly used.
The next part of the legend behind the flag of Scotland takes place over 700 years later, in 832 AD. It's said that the night before the Pictish King Angus II, led his forces into battle against the English King Aethelstans' army of Angles and Saxons, King Angus had a vision or dream. In this vision, he saw St. Andrew and was promised triumph in battle. Early the next morning Angus' troops were awestruck by the sight of a huge white Saltire cross shining against the background of a bright blue sky.
This 'omen' led the Scottish troops to victory and the Saltire found its place in Scottish history.
Click Here for more information