In the 2260's Dr. Daystrom began producing a series of experimental computer systems which he labelled the M series. M-1 through 4 were failures, but the M-5 was a success. Based on the multitronic principle, the computer offered an enormous leap forward compared to the duotronic systems which Dr. Daystrom had also invented some years before. Daystrom was convinced that the M-5's space applications would be amongst the most successful. He envisaged starships operating entirely under the control of the computer, with little or no crew carried.
Starfleet command was sufficient convinced of this possibility to devote major resources to the M-5 project. Five Constitution class Starships were assembled - the USS Enterprise, Lexington, Excalibur, Hood and Potempkin. The Enterprise had all but nineteen of its crew removed and an M-5 unit installed in their place, with Dr. Daystrom along to monitor the computers performance. The other four ships were to form a strike force to fight against the M-5 in tactical exercises in order to test the units effectiveness.
The initial test went according to plan. The Lexington and Excalibur attacked the M-5 whilst it was in the vicinity of Alpha Carinae II. The ships fought under standard exercise conditions, with phasers set to 1% power and minimal shielding. Under the control of the computer, the Enterprise was able to react far more quickly than any Human crew, outmanoeuvring the two starships and landing repeated phaser strikes on them.
Once the exercise was over, the M-5 proceeded with its testing. It subsequently came across the Woden, a robotic ore freighter. The computer approached the Woden at warp speed and fired photon torpedoes, completely destroying it. All attempts to disconnect the M-5 failed; the computer had established a secure link to the ships power systems and re-routed controls around any attempt to disconnect them. It also refused to allow the crew to make any communications off the ship.
Shortly afterwards all four ships in the attack force launched a simulated attack on the Enterprise. The M-5 responded with full power phaser strikes against the ships, inflicting heavy damage on them. The Excalibur was particularly badly hit, with Captain Harris and the entire crew being killed in the battle.
Dr. Daystrom attempted to convince the M-5 to discontinue the battle, but without success. Under heavy stress due to the failure of his system, Daystrom underwent a severe nervous breakdown. Captain Kirk was subsequently able to cause the M-5 to disconnect itself when he pointed out that in its determination to survive so that it could spare men from having to die in space had led it to commit murder.
Meanwhile Commodore Wesley, convinced that Captain Kirk had launched the attack for some reason, had gained permission from Starfleet command to destroy the Enterprise with his remaining force. With the Enterprise helpless, Wesley closed in for the kill. Kirk cut all main power in the ship, playing dead in the hope that Wesley would not attack a helpless target. Kirk was proved right, and Wesley called off his attack. 
The repercussions of the M-5 debacle have been profound and long lasting. While Starfleet continued to use unarmed robotic units such as the Woden for some duties, no armed Starfleet vessel would ever again operate under total computer control. In part this was because such systems had been so tainted by the M-5 that it was politically impossible to continue with them. More importantly however, Starfleet has recognized that the purpose of exploration is not just the filling in of details on stellar maps or the expansion of scientific knowledge. It is to fulfil the spirit, to expand and improve ourselves. With this in mind, unmanned exploration vessels would be pointless.
After the M-5 incident Dr. Daystrom was committed to a total rehabilitation centre for some time. He eventually made a full recovery, but although he returned to computer science and made several further contributions, never again did his work have a major influence on the field.