On 16 June 1846, Giovanni Maria Mastai-Ferreti, the Archbishop of Imola, was elected to the papacy on the fourth ballot. Upon his election he took the name of Pius IX.
Austrian Emperor Ferdinand had sent the Cardinal Karl Kajetan Gaisruck, the Archbishop of Milan [which at that time was part of the Austrian Empire] to veto the election of Ferretti because he was perceived to be too liberal.* However, by the time Gaisruck arrived at the conclave, Ferretti had already been publicly proclaimed to be the new pope.
Pius IX was crowned as pope on 21 June 1846 and would be the longest reigning pope since St. Peter. He served as pope for almost 32 years.
Although he had been chosen for the papacy with the reputation for liberalism, after the Revolutions of 1848 and his forced flight from Rome Pius IX would become a strong supporter of conservatism.
More on the Conclave of 1846
*There were several times at which a European ruler would try to veto the election of a particular candidate which they did not favor. While the cardinals at a papal conclave never officially recognized the rite of a secular ruler to veto a particular papal election, usually a vetoed candidate would not be chosen by the conclave. See Jus exlusivae