G (detective) Division was a plainclothes divisional office of the Dublin Metropolitan Police concerned with detective police work. Divisions A to F of the DMP were uniformed sections responsible for particular districts of the city.
The Division was established in 1842. The G Division was purely investigative, consisted of plainclothes detectives and was unique to the DMP.  'Instead of having detectives attached to each division, as was the practice in London, the Dublin Police administration established one central office, or G Division, for the whole district at Exchange Court, Dublin Castle. A superintendent, two sergeants and 14 constables were assigned to the Detective Division. A certain number of constables were on duty day and night, while others were exclusively employed in connection with the pawnbrokers' offices. Special attention and continuous watch was kept on the networks of receivers of stolen goods.' By 1859 much of the G Division's work was concerned with Fenianism. Superintendent Daniel Ryan headed the detectives answering to Sir Henry Lake, chief commissioner of the Dublin Metropolitan Police (DMP). Ryan had an informer named Pierce Nagle within the offices of the Fenian Irish People newspaper. In 1865 Nagle warned Ryan about an "action this year" message on its way to the Irish Republican Brotherhood unit in Tipperary. On 15 July 1865 Irish American plans for an IRB rising in Ireland were discovered when the emissary lost them at Kingstown railway station. Ryan raided the offices of the newspaper on 15 September and the staff were arrested. They were tried and sentenced to terms of penal servitude.
In 1874 John Mallon succeeded Ryan as head of G Division. Mallon's father had been linked with the Ribbon Society but the son had specialised in his career working against Irish republicanism. He had an extensive knowledge of the separatists and operated a personal network of spies and informers. In the 1880s G Division was pitted against separatist insurgents including the Invincibles. It also operated against the Land League and even the Irish Parliamentary Party, arresting Charles Stewart Parnell in 1881. Mallon supervised G Division until his retirement in January 1902. To protect his informants, Mallon had refused to commit much of his knowledge to paper.
The unarmed and uniformed majority of the Dublin Metropolitan Police played a relatively neutral role during the troubles of 1919, restricting their functions to such traditional roles as criminal investigation and traffic control. However an expanded G Division was employed as an active intelligence agency against the IRA. In his book "The Spy in the Castle" David Neligan (an IRA double agent who infiltrated G Division) suggests that much of this activity was unprofessional, dependent upon casually recruited local spies and English officers whose wartime experience in Cairo and elsewhere had little relevance to Dublin conditions.
Several DMP officers actively assisted the IRA during the Irish War of Independence (1919–21), most famously Edward Broy, who passed valuable intelligence to IRA leader Michael Collins throughout the conflict. Broy was a double agent with the rank of Detective Sergeant (DS)  and worked as a clerk inside the G division branch. While there he copied sensitive files for Collins and passed many of these files on to him through Thomas Gay, the librarian at Capel Street Library. On 7 April 1919, Broy smuggled Collins into G Division's archives in Brunswick Street, enabling him to identify "G-Men", six of whom would be killed by the IRA.
In November 1923 the division was merged with "Oriel House", the Free State Intelligence Department. The new Detective Branch was put under the control of Colonel Neligan, then Director of Intelligence in the Free State Army.