The M-5 computer or the M-5 multitronic unit was created by Doctor Richard Daystrom. It utilized very sophisticated technology, probably similar to the Human neural network, and much more sophisticated than the duotronic computer commonly in use at the time. According to Dr. Daystrom, the computer could think and reason like a Human. He had used his own memory engrams as a model for the computer. Models M-1 through M-4 were not entirely successful.
M-5 was installed on board the USS Enterprise in 2268 as a test of its capabilities. It was due to command and control the ship during several battle simulations, where up to four other starships would attack the Enterprise. Manned with only a skeleton crew of twenty, the ship was completely run by the computer.
The unit was located in main engineering, and tapped directly into the ship's main power grid. When requiring more power, it would shut down unnecessary systems, including life support on decks without crewmembers.
During battle drills, the computer's self-preservation instinct became dominant, resulting in the destruction of the robot ship Woden and the deaths of several hundred Starfleet officers when it destroyed the USS Excalibur .
The senior crew attempted to cut off the computer from the ship's controls, but M-5 rerouted command functions through new data lines, and kept sending false signals through the original ones. The computer could also generate a force field around itself, effectively preventing anyone from coming near it.
Captain James T. Kirk made the computer self-destruct by asking it if it was right to kill another being. M-5 said that it was a crime against the laws of Man and God, and, believing that such a crime was punishable by death, deactivated itself. (TOS: "The Ultimate Computer")
In the game Star Trek: Shattered Universe the player must defeat the M-5 which has taken control of the mirror universe counterparts of the USS Excalibur, USS Hood, USS Lexington and USS Potemkin and their fighters by destroying all four starships which shuts down the smaller vessels.
Strangely enough, while the other computers on the Enterprise have a female voice, the M-5 computer has a male voice.