William Melville William Melville ( 25 April 1850 – 1 February 1918 ) was an Irish law enforcement officer and the first chief of the British Secret Service , forerunner of MI5 . Birth . William Melville was born son of a baker and publican in Direenaclaurig Cross , Sneem , County Kerry , Ireland . He moved to London in the 1860s and followed his father ' s footsteps as a baker before he joined the Metropolitan Police in 1872 . He married Catherine ( Kate ) O ' Reilly on 20 February 1879 in London ( St Saviour ) . He was once dismissed for insubordination but was later reinstated and later promoted to the Criminal Investigation Department ( CID ) . Scotland Yard . In 1882 he was chosen to be one of the founding members of the Special Irish Branch that was founded to work against Fenians and anarchists . Melville was posted to the Le Havre port , during which posting his children , James Benjamin ( 1885 ) ( later Sir James Melville KC ) and Cecile Victorinne ( 1886 ; died in London in 1891 ) , were born . In December 1888 Melville returned to London and assigned to protect the Shah of Persia in his state visit . His duties later expanded to the protection of British Royal Family and he foiled the Jubilee Plot against Queen Victoria in 1887 . In 1891 he began to campaign against anarchists by raiding and wrecking anarchist clubs and underground printing houses . He also revealed the Walsall Plot . In 1893 Melville became Superintendent of Scotland Yard ' s Special Branch when his predecessor John Littlechild retired to become a private investigator . When he fired veteran sergeant Patrick McIntyre , McIntyre went to press and claimed that Melville had instigated the whole Walsall Plot himself , a claim vindicated by police files released over 80 years later . In the next ten years , Melville embarked on a large series of well - publicized raids against anarchists . He went to Victoria Station to personally arrest bomber Théodule Meunier . In 1896 Melville recruited Shlomo Rosenblum ( later known as Sidney Reilly ) as an informer in an organization he suspected to be involved with Russian anarchists . In 1901 he worked with Gustav Steinhauer of the German Secret Service to thwart a plot against the Kaiser during the state funeral of Queen Victoria . In June 1900 Melville met future stage magician Harry Houdini when he came to Scotland Yard to showcase his abilities as an escapologist . When Houdini released himself easily from the police handcuffs , Melville befriended him and reputedly learned lock picking . On 1 November 1903 , Melville resigned as superintendent but was secretly recruited to lead a new intelligence section in the War Office , MO3 , which subsequently was redesignated M05 . Working under commercial cover from an unassuming flat in London under the alias persona William Morgan , Melville ran both counterintelligence and foreign intelligence operations , capitalizing on the knowledge and foreign contacts he had accumulated during his years running Special Branch . In 1909 the Government Committee on Intelligence , with advocacy of Richard Burden Haldane and Winston Churchill , established a new Secret Service Bureau with a Home Section under command of Captain ( Later General ) Sir Vernon Kell and a Foreign Section under Commander ( later Admiral ) Sir Mansfield Cumming . Melville ' s unit was folded into Kells department , which , while acting in Home matters , remained subordinate to the War Office . By 1910 it was clear that the Home Section and the Foreign Section would seek their own identities , and Kell ' s department , the Security Service separated from Cummings ' Secret Intelligence Service . In 1916 MO5 was redesignated MI5 and remained the most secret of all British spy agencies right up through the 1990s . According to the conclusions of author Andrew Cook , his biographer , which are not accepted by all historians , Melville then became the head of British Secret Service with the code name " M " . Still , the service had small budget and on occasion Melville had to do the job himself . Secret Service Bureau . After 1903 , when relations between Britain and Germany cooled , William Melville lobbied the government to create a counter - espionage service . In 1906 Melville obtained German mobilization plans and investigated their financial support to the Boers . He hired a Courage Brewery representative in Hamburg to supply intelligence for him and in 1909 went to Germany himself to recruit more agents . Melville ' s request was granted in October 1909 when the War Office authorized the creation of the Secret Service Bureau , nineteen military intelligence departments - MI1 to MI19 , but MI5 and MI6 came to be the most recognized as they are the only ones to have remained active to this day . His own section continued as a separate Special Section and he concentrated on looking for German spies . In August 1914 he eventually was able to identify the barbershop of Karl Gustav Ernst , that was the centre of a German spy ring . After the outbreak of World War I , Secret Service received more funding . Melville recruited more personnel for his section when it was attached to newly found G - section , that concentrated on investigating suspected agents . He also founded a spy school opposite the War Office at Whitehall Court . Death . William Melville died of kidney failure in February 1918 . According to : " Jim Fitzgerald . . . among a number of relations of Melville ' s still living in Sneem . . . " We ' re very proud of him . . . the last time he visited here was in 1913 , but he was watched by republicans and didn ' t stay long . Now everyone is very proud of his connection to here . " "