M is a fictional character in Ian Fleming's James Bond series. The character is the Head of Secret Intelligence Service, also known as MI6. Author Ian Fleming based the character M on a number of people he knew who commanded sections of British intelligence. Primary amongst these was Rear Admiral John Godfrey, who was Fleming's superior at the Naval Intelligence Division. Other inspirations include MI5 agent Maxwell Knight and Secret Service Bureau founder William Melville (both codenamed 'M'), Sir Ormonde Winter, former head of intelligence in Dublin Castle ('O') and MI6 heads Hugh Dansey ('Z') and Mansfield Smith-Cumming ('C').
M has appeared in the novels by Fleming and seven continuation authors, as well as appearing in twenty-four films. In the EON Productions series of films, M has been portrayed by four actors: Bernard Lee, Robert Brown, Judi Dench and Ralph Fiennes, who is the current incumbent; in the two unofficial productions, M has been played by John Huston and Edward Fox.