John O'Leary was born at Main Street, Tipperary, the eldest son of John O'Leary, a shopkeeper, and Margaret Ryan. His sister, Ellen O'Leary (1831-1889) was an Irish nationalist poet, and his younger brother Arthur, (who died of tuberculosis on 6 June 1861), took the oath of the Irish Republican Brotherhood. O'Leary never married, and after 1885, lived with his sister in Dublin.
O'Leary was a journalist, and a leader of the Fenian movement for Irish independence. He studied law at Trinity College, Dublin, where he attended nationalist movement meetings. After a short imprisonment in 1848, and on discovering that he could not become a barrister without taking an oath of allegiance to the British crown, he turned to medicine. He attended Queen's College, Cork, for two years, then Queen's College, Galway, where he contributed occasionally to the Nation. In 1854 he moved to London to continue his studies, and in 1855 left to live and study in Paris for fourteen months.
It was during this journey that he met Whistler, either at a station between Boulogne and Paris, or on the steamer to Le Havre. By the time they arrived at the French capital, O'Leary had decided to lodge with Whistler at the Hotel Corneille (Rue Corneille), which had a mixture of medical and art students; he stayed there for three months. Anderson suggests that Whistler's introduction to Irish nationalists 'on the run' in Paris by O'Leary, in combination with his Irish ancestry and recent soldier-cadet past, coloured his view of Irish and British politics.
O'Leary returned to Ireland, but often travelled to Britain and America on clandestine Fenian Brotherhood business. After many trips back and forth to London in August 1861, he moved there permanently, to 4 Thames Terrace, Pimlico, where renewed his friendship with Whistler, who lived close by in Chelsea. O'Leary returned to Dublin in the summer of 1863, when he became joint editor and chief writer of the Irish Republican Brotherhood paper, Irish People, but was again in London in 1864.
A year later, on 15 September 1865, O'Leary was arrested in Dublin for treason. It was alleged that he was the 'financial manager' of the Fenian movement, who brought money raised by American sympathisers into the country; this 'American connection' may explain why the letters from Whistler, which were among many documents seized at the time of his arrest, were kept by the Irish authorities. On 7 December 1865 O'Leary was found guilty of treason and sentenced to 20 years penal servitude. Many of O'Leary's friends were arrested at the same time, and Whistler may have been afraid of becoming involved. Shortly afterwards, in February 1866, Whistler left for Valparaiso, Chile, for eight months.
O'Leary spent five and a half years in Portland Prison, Dorset, and was then exiled to France for fourteen years, where he could have met up with Whistler during the 1870s. Thomas Armstrong stated in 1912, 'I believe the two kept up friendly relations until quite recent years'. On 19 January 1885, O'Leary was able to return to Ireland under the Amnesty Act. Anderson suggests that he met Whistler on the latter's trip to Ireland in 1900. A note in O'Leary's diary points to a meeting at the Shelbourne Hotel, Dublin, where Whistler spent his first night in the country, on the 20 August 1900.
Anderson, Ronald, Whistler - the Unexplored Irish Factors, M.A. thesis, University of St. Andrews, 1985, pp. 20-41, 102; Anderson, Ronald, and Ann Koval, James McNeill Whistler: Beyond the Myth, London, 1994, pp. 152-153, 155-156; O'Leary, John, Recollections of Fenians and Fenianism, London, 1896; Armstrong, Thomas, Thomas Armstrong, C.B.: A Memoir, 1832-1911, ed. L. M. Lamont, London, 1912, p. 172; Bourne, Marcus, John O'Leary: A Study in Irish Separatism, Tralee, 1967; Dictionary of National Biography, Oxford, 2004.