This is an old prayer that dates back to the 3rd century where it was found on Egyptian papyrus in 1917. As such, it is one of the earliest known prayers to the Blessed Virgin. This significantly predates the Hail Mary which is dated at the fifteenth or sixteenth century.

The 3rd century was a difficult time for Christianity with the Roman Emperors Septimius Severus and Decius persecuting Christianity. Thus a short prayer asking for protection from dangers was a common request. During the middle ages, the Sub Tuum was added as liturgical prayer and was one of the four Marian anthems recided at the conclusion of the Night Prayer. Because that this was when it became part of the accepted set of prayers, many mistake the Sub Tuum as being created then.

Furthermore, the age of this prayer shows that the term "Mother of God" was used well before the use by St Athanasius who is often credited with the creation of that phrase. This title does have some relationship to Egypt where the Egyptian Goddess Isis was titled this as mother of the god Horus. This is another example of Christianity adopting a local custom and incorporating it into itself.

In English

We fly to thy patronage, O holy Mother of God; despise not our petitions in our necessities, but deliver us always from all dangers, O glorious and blessed Virgin. Amen.

In Latin

Sub tuum praesidium confugimus, Sancta Dei Genetrix. Nostras deprecationes ne despicias in necessitatibus, sed a periculis cunctis libera nos semper, Virgo gloriosa et benedicta. Amen.


http://www.unidial.com/~martinus/thesaurus/BVM/SubTuum.html
http://www.fms-sydney.org.au/spirituality/sub_tuum.html