Pope Pius IX and Germany often had tense relations during his long papacy that culminated with the country's anti-Catholic persecutions during the 1870s Kulturkampf shortly before Pius's death. However, the Catholic Church also experienced a period of continuous growth in terms of the number of laity and of clergy. 
 During the pontificate of Pius IX, the Catholic Church began to flourish and to expand after the 1848 German Revolution caused additional religious freedoms in Protestant areas. The German laity formed Pius Vereine and numerous other organizations loyal to the papacy and wanted to practice Catholic teachings in everyday life. The German bishops formed one of the first Catholic Bishop Conferences, which have been held annually ever since 16 November 1848. They formulated requests to the German State and issued pastoral directives. The Pope welcomed the association but refused to give permission to hold of a German regional council. The Constitution of Prussia (1850) guaranteed the complete freedom of the Catholic Church.
 Decisive military victories of Prussia against other German states and Austria at the Battle of Königgrätz in 1866, and of German states in Sedan against France in 1870 and the creation of the German Empire in 1870 with a Protestant emperor were viewed in Berlin as a victory of Protestantism over Catholicism. The outcome of the First Vatican Council with the definition of papal infallibility raised Protestant and liberal Catholic fears of papal interference in German affairs and resulted with the Kulturkampf by Chancellor Otto von Bismarck in drastic restrictions for the Catholic Church in the areas of education, sermon preaching, the formation of its priests and the functions of bishops. Five of the eleven Prussian bishops were arrested. Several religious orders and congregations were outlawed, and Jesuits had to leave the country because of a 7 July 1872 law until they were readmitted in 1917.
 Catholics were considered to be loyal to the Pope, not to Germany, and so did not have the same civil rights or access to government positions as Germans who were Protestant or Jewish. By 1878, two thirds of the Catholic bishops had been forcefully removed from their positions, and over 1000 parishes were without priests.
 Germany attempted to weaken the Catholic Church by expropriating churches and institutions and turning them over to the Old Catholic Church, a small group of liberal Catholics that had split after Vatican I, but it failed to gain much popular support despite state intervention. The Protestant rulers of the Grand Duchy of Baden claimed the right to appoint not only bishops but also parish priests and other positions in the Catholic Church. 
 The Prussian government declared that Catholic seminarians had to undergo a state examination before they could be ordained. Despite protests by Pius IX, Archbishop Hermann von Vicari, who was 80 years old, refused and went through a criminal trial resulting in his round-the-clock government surveillance by the Prussian State Police. The priests under his watch were imprisoned, exiled or fined.
 Despite or some say because of the ongoing persecution, Catholicism in Germany was actually strengthened. The political representatives of the Centre Party gained popularity, and its press and local organisations flourished. After the death of Pius IX, Bismarck attempted to make peace with the more diplomatic successor, Pope Leo XIII, and over time rescinded most of the discriminatory legislation against the Catholic Church and populations. On 27 May 1887, Leo XIII announced the formal end of the Kulturkampf