"G-man" (short for "government man", plural G-men) is an American slang term for agents of the United States Government. It is especially used as a term for an agent of the Federal Bureau of Investigation (FBI).

"G-man" is also a term used for members of "G Division", essentially a British anti-rebel police unit operating out of Dublin Castle prior to Irish Independence in 1922. Colonel Ned Broy uses the term in his official testimony for the Irish Army's Bureau of Military History in their archive of the Easter Rising (1916) & the Irish War of Independence (1919–1921).

According to the Merriam-Webster Dictionary, the term "G-man" was first used in the year 1928. The earliest citation in the Oxford English Dictionary for the American usage of the term "G-man" was in 1930, from a biography of Al Capone by F. D. Pasley. The nickname may have originated during the September 1933 arrest of the gangster George "Machine Gun" Kelly by agents of the Bureau of Investigation (BOI), a forerunner of the FBI. Finding himself unarmed, Kelly supposedly shouted, "Don't shoot, G-men! Don't shoot!" The term was the basis of the title for the 1935 film "G Men", starring James Cagney, which was one of the top-grossing films of that year.

More Info: en.wikipedia.org