in the town, their influence waned during the 13th century. Financial difficulties forced the Bishop to sell the Ajoie (including Porrentruy) back to the lords of Montbéliard in 1386. But in 1461, the town once again became subject to the episcopal see. Because of the Reformation in Basel, the Bishopric moved its official headquarters to Porrentruy in 1527. Under Bishop Jakob Christoph Blarer von Wartensee, who reigned from 1575 to 1608, the town reached the apogee of its importance. In his time, many architectural projects, including expansion of the castle and the building of a Jesuit college, were undertaken. This period of prosperity ended in 1618 with the outbreak of the Thirty Years' War. Porrentruy was repeatedly occupied, besieged, and plundered. The first parish church of Saint-Germain was replaced in the 13th century by a new building, which underwent several renovations. The Church of Saint-Pierre was completed in 1349 and became the parish church in 1475. The cathedral chapter was established in 1377. Several religious orders were active in the city, including the Jesuits who built their college in 1591. In addition to the Jesuits other orders included the Ursulines (1619), the Sisters of the Annonciade (permanently established in 1646) and the Capuchins (1663). The first uprising against the Bishop's power was under the Comité de la Commune de Porrentruy on 20 August 1790, but they were unable to expel the Bishop. However, on 27 April 1792, French Revolutionary troops invaded the city and drove the Bishop out. Porrentruy became the capital of a dependent republic, which was then incorporated into France in 1793 as the Département du Mont-Terrible. In 1800, this department was incorporated into the Département du Haut-Rhin as a sub-département. During the War of the Sixth Coalition against Napoleon, Allied troops entered Porrentruy on 24 December 1813. Following their liberation, the future of this former episcopal seat was uncertain. The government divided into two parties, the Episcopal party that sought the return of the prince bishop as the head of a Swiss canton, while the French party wanted to retain the current secular government. However, soon after the fall of Napoleon, the municipality was given to the Canton of Bern (in 1815) to compensate for the loss of the Canton of Vaud, which had become a separate canton in 1803. Both factions, the religious and the secular, retained power in the town in the following years. The