O'Hagan was born and raised in the lower Falls area of Belfast in a family steeped in socialism.
His grandfather was prominent in the 1907 Belfast dock strike organised by trade union leader Jim Larkin and there were also family associations with James Connolly, a socialist leader in the 1916 Easter Rising.
O'Hagan joined the IRA in Belfast at the age of 15. He later served four years in Crumlin Road jail for trying to help a prisoner escape from a hospital where he was waiting for an operation.
O'Hagan said it was in jail that he immersed himself in politics and realised that violence was wrong.
On his release he studied at the London School of Economics and graduated in 1965 before returning to a job in Stranmillis College in Belfast.
He rejoined the IRA but in 1967 became a driving force in the fledgling Northern Ireland Civil Rights Association (NICRA).
O'Hagan helped organise demonstrations and in later interviews described NICRA as a "serious political machine".
This probably accounted for his internment in August 1971. His letters documenting the ill-treatment of Long Kesh inmates were smuggled out of the camp and serialised in the Irish Times.
After his release he became the director of education for the Official wing of republicanism - renamed the Workers Party in 1982 - and he travelled to the Soviet Union.
However, at home he rued the growing rifts within his organisation. O'Hagan - nicknamed the Red Devil because of his opposition to the Catholic Church - gave graveside orations at the funerals of Workers Party members such as David Nocher who was killed by the UVF in Newtownabbey in 1983.
But David Ervine - a former UVF man himself and later an MLA, PUP leader and a political adviser to the loyalist terror group - would later forge a link with O'Hagan.
The republican once described the east Belfast loyalist politician in an interview as "a good fellow" who identified with his anti-sectarian and socialist ideals.
In a statement, the Workers Party described O'Hagan as a Marxist intellectual, author, political activist and polemicist who had "dedicated his life to class politics".