He was released from prison in 1919 and attended the proceedings of the First Dáil.
A successful businessman he was a tea merchant and a commercial traveller. His company, John O'Mahoney & Co., was located on Middle Abbey St., and was destroyed during the 1916 Easter Rising. It subsequently reestablished on Parnell Square.
He subsequently purchased and ran Fleming's Hotel which was located at 31-32 Gardiner Place, Dublin. He participated in the Easter Rising and was subsequently interned at Frongoch and Lincoln Jail. He remained with Sinn Féin after it was re-constituted as a republican party at the 1917 Ardfheis.
He was arrested during the German Plot of 1917 and was jailed in Lincoln Gaol in England. While imprisoned he was elected as a Sinn Féin MP for Fermanagh South in the 1918 general election. He was re-arrested at the Sinn Féin offices in November 1919 and was imprisoned for three months in England.
He would be arrested several more times throughout the Anglo-Irish War and his hotel was used as a meeting place by Sinn Féin members throughout the time. He was elected in the 1921 general election to the Second Dáil for Fermanagh and Tyrone. As a result of the Government of Ireland Act 1920 this election was to provide the membership of two assemblies: the Southern Ireland House of Commons and the Northern Ireland House of Commons.
The eight seat Fermanagh-Tyrone constituency was one of several in the Northern Ireland House of Commons. During the debates on the Anglo-Irish Treaty he opposed ratification of the document and voted against ratification. He left the Dáil with Éamon de Valera and the other Anti-Treaty TDs.
O'Mahoney was not invited to attend the opening of the Provisional Parliament. De Valera was keen for him to attend since if he had been refused entry it would have demonstrated, in the minds of Anti-Treaty supporters, that the assembly was not an All-Ireland Dáil. In the end O'Mahoney did not attend, but his case was taken up by Laurence Ginnell.
He remained an abstentionist MP to Stormont until the Northern Ireland general election, 1925, when he did not stand for re-election. He remained with Sinn Féin after the 1926 split, serving on the party's Ard Chomairle until his death. He died in 1934. His funeral was attended by representatives of Sinn Féin, the Irish Republican Army, Fianna Fáil, Fianna Éireann, Cumann na mBan, and Mná na Poblachta.
He is buried in Glasnevin Cemetery.
[Irish Republican Brotherhood. 31st United Kingdom Parliament]
As members of Sinn Féin did not recognise either assembly he and the other five Sinn Féin TDs continued to attend the Dáil. As the only member of the Second Dáil not elected to the Southern Ireland House of Commons, his status in the Third Dáil in 1922 was unclear.