On 20 July 1903, Leo XIII died, and at the end of that month the conclave convened to elect his successor.
According to historians, the favorite was the late pope's secretary of state, Cardinal Mariano Rampolla.
On the first ballot, Rampolla received 24 votes, Gotti had 17 votes, and Sarto 5 votes.
On the second ballot, Rampolla had gained five votes, as did Sarto.
The next day, it seemed that Rampolla would be elected.
However, the veto (jus exclusivae) against Rampolla's nomination, by Polish Cardinal Jan Puzyna de Kosielsko from Kraków in the name of Emperor Franz Joseph (1848–1916) of Austria-Hungary, was proclaimed.
Many in the conclave, including Rampolla, protested against the veto, and it was even suggested that he be elected pope despite the veto.

However, the third vote had already begun, and thus the conclave had to continue with the voting, which resulted in no clear winner, though it did indicate that many of the conclave wished to turn their support to Sarto, who had 21 votes upon counting.
The fourth vote showed Rampolla with 30 votes and Sarto with 24.
It seemed clear that the cardinals were moving toward Sarto.

On the following morning, the fifth vote of the conclave was taken, and the count had Rampolla with 10 votes, Gotti with two votes, and Sarto with 50 votes.
Thus, on 4 August 1903, Sarto was elected to the pontificate.
This marked the last known time a veto would be exercised by a Catholic monarch in the proceedings of the conclave.

At first, it is reported, Sarto declined the nomination, feeling unworthy.
Additionally, he had been deeply saddened by the Austro-Hungarian veto and vowed to rescind these powers and excommunicate anyone who communicated such a veto during a conclave.
With the cardinals asking him to reconsider, it is further reported, he went into solitude, and took the position after deep prayer in the Pauline chapel and the urging of his fellow cardinals.

In accepting the papacy, Sarto took as his papal name Pius X, out of respect for his recent predecessors of the same name, particularly that of Pope Pius IX (1846–1878), who had fought against theological liberals and for papal supremacy.
Pius X's traditional coronation took place on the following Sunday, 9 August 1903.
Upon being elected pope he was also formally the Grand Master of the Equestrian Order of the Holy Sepulchre of Jerusalem, prefect of the Supreme Sacred Congregation of the Holy Office, and prefect of the Sacred Consistorial Congregation.
There was however a cardinal-secretary to run these bodies on a day-to-day basis.
On 20 July 1903, Leo XIII died, and at the end of that month the conclave convened to elect his successor. According to historians, the favorite was the late pope's secretary of state, Cardinal Mariano Rampolla. On the first ballot, Rampolla received 24 votes, Gotti had 17 votes, and Sarto 5 votes. On the second ballot, Rampolla had gained five votes, as did Sarto. The next day, it seemed that Rampolla would be elected. However, the veto (jus exclusivae) against Rampolla's nomination, by Polish Cardinal Jan Puzyna de Kosielsko from Kraków in the name of Emperor Franz Joseph (1848–1916) of Austria-Hungary, was proclaimed. Many in the conclave, including Rampolla, protested against the veto, and it was even suggested that he be elected pope despite the veto.
However, the third vote had already begun, and thus the conclave had to continue with the voting, which resulted in no clear winner, though it did indicate that many of the conclave wished to turn their support to Sarto, who had 21 votes upon counting. The fourth vote showed Rampolla with 30 votes and Sarto with 24. It seemed clear that the cardinals were moving toward Sarto.
On the following morning, the fifth vote of the conclave was taken, and the count had Rampolla with 10 votes, Gotti with two votes, and Sarto with 50 votes. Thus, on 4 August 1903, Sarto was elected to the pontificate. This marked the last known time a veto would be exercised by a Catholic monarch in the proceedings of the conclave.
At first, it is reported, Sarto declined the nomination, feeling unworthy. Additionally, he had been deeply saddened by the Austro-Hungarian veto and vowed to rescind these powers and excommunicate anyone who communicated such a veto during a conclave. With the cardinals asking him to reconsider, it is further reported, he went into solitude, and took the position after deep prayer in the Pauline chapel and the urging of his fellow cardinals.
In accepting the papacy, Sarto took as his papal name Pius X, out of respect for his recent predecessors of the same name, particularly that of Pope Pius IX (1846–1878), who had fought against theological liberals and for papal supremacy. Pius X's traditional coronation took place on the following Sunday, 9 August 1903. Upon being elected pope he was also formally the Grand Master of the Equestrian Order of the Holy Sepulchre of Jerusalem, prefect of the Supreme Sacred Congregation of the Holy Office, and prefect of the Sacred Consistorial Congregation. There was however a cardinal-secretary to run these bodies on a day-to-day basis.
Pope Pius X