The origins of a prayer rope can be traced back to Saint Anthony the Great who tie a leather rope with a knot every time he prayed "Lord have Mercy" , but every time he tied a knot, the devil would come behind him and untie it. He then devised a method in which he could tie the knot in the form of a cross - sanctifying it so that the Devil could not untie it and would be vanquished each time he tried.
In very early Christianity, the Desert Fathers used small pebbles tossed into a bowl to aid them in counting the 150 psalms. Saint Pachomius the Great in the fourth century widely distributed the prayer hope to aid illiterate monks in their cells. Many of the monks he knew would use the pebbles to count how many times they had prayed the Jesus Prayer, using the rope was not only easier, but could be carried with them as they traveled, allowing them to pray constantly (much as in I Thessalonians 5:17).
In 1206, Saint Dominic was converting the Albigensians back to their faith in Prouille France and had a vision of the Blessed Virigin. She gave Saint Dominic the Rosary, explaining that it was an effective tool against heretics. Centuries later, the Dominican friar Alan de la Roche helped spread the use of the rosary, successfully popularizing it's use. In his writing Trésor des livres rates et précieux, he wrote that saying 150 Hail Mary's instead of the Psalms came from Saint Dominic. The Rosary became an official apostolate of the Dominican order during this time.
In 1571, the Ottoman empire was threatening Italy and the outpost in Cyprus looked likely to fall. Pope Pius V organized a military group called the Holy League made up of the following forces:
Papal States under Pius V
Habsburg Spain under Philip II
the Republic of Venice
the Republic of Genoa
the Knights of Malta
the Grand Duchy of Tuscany under Cosimo I de'Medici
the Duchy of Savoy under Emmanuel Philibert
the Duchy of Urbino under Guidobaldo II della Rovere
the Duchy of Parma under Ottavio Farnese.
On October 7th, this force set set sail from Messina Sicily and met the Ottoman fleet in the Gulf of Corinth in 1571. Knowing the forces were outmatched, Pope Pius V called for all of Europe to pray the rosary and ordered a massive rosary procession in Rome dedicated to Our Lady. Should the fleet fail, there was a distinct and real possibility that the Ottoman army would have been able to invade Italy and hold Rome. The battle was a total victory for the Holy League, and although the Ottoman Empire would eventually take Constantinople, it's navy would never recover and the empire ceased to be a maritime threat.
Pope Pius instituted the annual "Our Lady of Victory" feast to celebrate the victory, attributing it to the devotion of the Blessed Virgin Mary. In 1573, Pope Gregory XIII changed the title to "Feast of the Holy Rosary" to be celebrated on the first Sunday of October. The Dominican Friar Juan Lopez wrote in 1583 that the feast was offered
"in memory and in perpetual gratitude of the miraculous victory that the Lord gave to his Christian people that day against the Turkish armada"
Pope Pius X changed the date to October 7th in 1913 to restore celebration of the liturgy to Sundays. Pope Paul VI mentioned the feast day as a Mandatory Memorial.