<P> The castle became a jail under Louis XV but, in 1789, the General Estates Assembly ordered the liberation of prisoners . Following the rise of Napoleon in 1803, he again made the Castle an Estate jail . Towards the end of the Peninsular War between France, Spain, Portugal, and Britain in 1814, British and Allied forces, under the Duke of Wellington, entered France and took control of the region and followed Marshall Soult's army, defeating the French near the adjoining town of Tarbes before the final battle took place outside Toulouse on 10 April 1814 brought the war to an end . </P> <P> Up until 1858, Lourdes was a quiet, modest, county town with a population of only some 4,000 inhabitants . The castle was occupied by an infantry garrison . The town was a place people passed through on their way to the waters at Barèges, Cauterets, Luz - Saint - Sauveur and Bagnères - de-Bigorre, and for the first mountaineers on their way to Gavarnie, when the events which were to change its history took place . </P> <P> On 11 February 1858, a 14 - year - old local girl, Bernadette Soubirous, claimed a beautiful lady appeared to her in the remote Grotto of Massabielle . This lady later identified herself as "the Immaculate Conception" and the faithful believe her to be the Blessed Virgin Mary . The lady appeared 18 times, and by 1859 thousands of pilgrims were visiting Lourdes . A statue of Our Lady of Lourdes was erected at the site in 1864 . See Our Lady of Lourdes for more details on the apparitions . </P> <P> Since the apparitions, Lourdes has become one of the world's leading Catholic Marian shrines and the number of visitors grows each year . It has such an important place within the Roman Catholic church, that Pope John Paul II visited the shrine twice: on 15 August 1983, and 14--15 August 2004 . In 2007, Pope Benedict XVI authorized special indulgences to mark the 150th anniversary of Our Lady of Lourdes . </P>

What happened in lourdes to make it a place of pilgrimage
find me the text answering this question