He joined
Sinn Féin at its inaugural meeting on 5 November 1905. Following the 1916
Easter Rising, O'Kelly joined the Irish Nation League and became treasurer of the ''Irish National Aid and Volunteers' Dependants' Fund'' for the relief of prisoners and their families. In February 1917, he was arrested and deported to
England where he was interned without trial for several months. On his release O'Kelly was elected to the Provisional Committee of the newly merged Irish Nation League and Sinn Féin, thereafter called Sinn Féin. He was appointed editor of the influential "
Catholic Bulletin". In the
1918 general election he was elected as a Sinn Féin MP for
Louth by 255 votes in what was the closest contest in Ireland in that election. The closeness of the contest was due to the strong
AOH organisation in the county that campaigned for outgoing North Galway MP Richard Hazleton of the
Irish Parliamentary Party. O'Kelly took his seat in
Dáil Éireann as a
Sinn Féin TD and was
Leas-Cheann Comhairle (deputy chairperson) from 1919 to 1921. He was appointed
Minister for Irish in the
Government of the 2nd Dáil. This position that was expanded as the
Minister for Education in the Government of the 2nd Dáil. From 1919 to 1923, he was President of the
Gaelic League. He opposed the
Anglo-Irish Treaty that was ratified by the Dáil in January 1922, and refused to accept the legitimacy of the
Irish Free State established in December 1922. He and others maintained that the
Irish Republic continued to exist and that the rump of the Second Dáil, composed of those anti-Treaty TDs who had refused to take their seats in what became the Free State parliament, was the only legitimate government for the whole of Ireland. In June 1922, he was elected to the
Third Dáil for the constituency of Louth-Meath but
abstained from taking his seat. In August 1923, standing as a Republican for the Meath constituency, he was defeated for an abstentionist seat in the
4th Dáil. He was again defeated in the Roscommon by-election of 1925, his last election attempt. After the resignation of
Éamon de Valera as president of Sinn Féin in 1926, O'Kelly, who maintained an abstentionist policy towards Dáil Éireann, was elected in his place and remained in this position until 1931 when
Brian O'Higgins took over the leadership. O'Kelly was hostile towards the 1937
Constitution of Ireland, claiming it was insufficiently supportive of
Irish Republicanism and that the Constitution also did not require the
President of Ireland to be of Irish birth. Sceilg was unusual among Irish Republicans in that he regarded
Daniel O'Connell and
T.M. Healy as political heroes. This apparently reflected local patriotism (both men came from south-western Ireland near to Sceilg's own birthplace) and Sceilg's own devout Catholicism, which led him to exalt O'Connell's achievement of
Catholic Emancipation and Healy's claims that the adultery of
Charles Stewart Parnell with
Katharine O'Shea made Parnell unfit for political leadership. Sceilg was also explicitly hostile to the
Spanish Republic declared in 1931, believing it to be anti-Catholic and supported by pro-British
Freemasons. ==Literary interests==