There were two governments of the 2nd Dáil, which were ministries of Dáil Éireann, the assembly of Dáil Éireann that was the legislature of the Irish Republic, a unilaterally declared state which lasted from 1919 to 1922. The Second Dáil was elected at the 1921 Irish elections on 24 May 1921. The 3rd ministry was led by Éamon de Valera as president and lasted 136 days. De Valera resigned as president after the Dáil voted to accept the Anglo-Irish Treaty. The 4th ministry was led by Arthur Griffith as president. Griffith died in office on 12 August 1922, but a new Dáil ministry was not formed until 9 September 1922. Griffith served 214 days as president, with a further 28 days between his death and the appointment of W. T. Cosgrave as his successor by the Dáil.