In April 1895, O'Kelly was elected as a Member of Parliament as an Anti-Parnellite Irish National Federation candidate at the by-election for the West Wicklow constituency, following the resignation of John Sweetman MP. However, Parliament was dissolved on 8 July for the 1895 general election, and O'Kelly decided not to defend his seat. Instead, O'Kelly focused on local politics, becoming the first chairman of the newly established Wicklow County Council in 1899.
