[7] During World War I, McKelvey Snr enlisted in the special reserve of the British Army and, in 1917, was posted to the Northumberland Fusiliers.
McKelvey participated in the Irish War of Independence 1919–1921 against the British, in which he commanded the IRA's 1st Battalion, Belfast Brigade.
[11] In July 1920, during a wave of violence in the wake of the IRA assassination of a northern police inspector (Gerard Smyth) in Cork, McKelvey was expelled from his job by loyalist intimidation.
McKelvey feared (and was proved correct) that such actions would provoke retaliatory attacks on the Catholic and Irish nationalist community by loyalists.
Nevertheless, he was unable to control some of his younger volunteers, who formed an "active service unit" on their own initiative and killed policemen and soldiers on a regular basis.
The IRA was then forced to try to defend Catholic areas, and McKelvey feared that the organisation was being drawn into sectarian conflict as opposed to what he saw as the "real" struggle for Irish independence.
In May 1921, McKelvey's command suffered a severe setback when fifty of his best men were sent to County Cavan to train and link up with the IRA units there, only to be surrounded and captured by the British Army on Lappanduff hill on 9 May.
[citation needed] Most of his comrades supported Michael Collins' assurances that, although the Treaty accepted the partition of Northern Ireland from the rest of the country, this was only a temporary concession which would be dealt with later.
As a result, he left his command as head of the IRA Third Northern Division and joined the republican side in Dublin.
[23] On 8 December 1922, Joe McKelvey was executed by firing squad along with three other imprisoned Anti-Treaty leaders, Rory O'Connor, Liam Mellows and Richard Barrett.
The executions had been explicitly ordered at a government cabinet meeting in reprisal for the Anti-Treaty IRA's murder of Seán Hales, a Pro-Treaty member of the Third Dáil.