No, he was not a real character, but he is probably the most famous fictional detective of all time and the most real of fictional characters!
His creator, Sir Arthur Conan Doyle, modelled this great detective on the methods and mannerisms of his former teacher at medical school, Dr. Joseph Bell of Edinburgh, whose diagnostic intuitions often surprised his patients and pupils.
Most of the 60 stories about Sherlock Holmes begin at 221B Baker Street in London, where he lived with his friend, Dr. Watson.