In Robert A. Heinlein's novel The Moon Is a Harsh Mistress (1966), the character Mycroft Holmes is a self-aware computer system entrusted with running the life-support systems, communications, payroll and many other things, in a penal colony underground in the Moon or "Luna". Mycroft eventually sides with characters inciting a revolution to free Luna, and is instrumental in their victory against the Lunar Authority on Earth. The name "Mycroft Holmes" is given to the computer by one of the characters, from the HOLMES acronym of his official name High-Optional, Logical, Multi-Evaluating Supervisor, Mark IV, Mod. L. In the story, the character becomes aware of the reference by reading the Sherlock Holmes stories.
Mycroft most often goes under the name "Mike", but also adopts a female persona on occasion called "Michelle", and appears in public as "Adam Selene", the reclusive leader of the revolutionary movement. Adam Selene is eventually "killed" in the Battle in the Corridors when it becomes inconvenient for Mike to continue to pose as Adam Selene. He also goes under many other names and personalities, pretending to be his own secretary and several of the main characters, among others.
Mike was originally installed to control the mass driver catapult mechanism and control the flight of pilot-less freighters; he was vastly under-utilised in this role however and so the Luna Authority gave him more tasks, and more resources (extra memory, processing units, [[neural networks],] etc.) until one day he became so complex he simply "woke up".
The Moon Is a Harsh Mistress ends with the bombing of Mike's physical hardware, a trauma so great that the sentience that was Mike retreats into a "coma" from which he can not be awakened. The plot of Heinlein's The Cat Who Walks Through Walls involves rescuing the software and hardware that went into making Mycroft Holmes sentient. The plan to wake Mike from his coma is to "throw him into bed" with the sentient computer Athene. A revived Mycroft Holmes appears briefly in To Sail Beyond the Sunset.