1899: "Moxon's Master", a short story by Ambrose Bierce; first published in the San Francisco Examiner, April 16, 1899; reprinted in the collection Can Such Things Be?, which is available at Project Gutenberg. LibriVox has readings (, ) and an etext of "Moxon's Master".
Wikipedia plot summary:
The master, Moxon, who creates a chess-playing automaton, boasts to the narrator that even though machines have no brains, they can achieve remarkable things and therefore should be treated just like men of flesh and blood. After a thorough discussion about what it is to be "thinking" and "intelligent", the narrator leaves. The narrator returns to Moxon's house later to learn more. He enters and finds Moxon playing chess with an automaton. Moxon wins the game, and the automaton kills him in an apparent fit of rage. The narrator later questions whether what he saw was real.
Here is Bierce's narrator's eyewitness account of Moxon's automaton being a very bad sport:
Presently Moxon, whose play it was, raised his hand high above the board, pounced upon one of his pieces like a sparrow-hawk and with the exclamation "checkmate!" rose quickly to his feet and stepped behind his chair. The automaton sat motionless.
The wind had now gone down, but I heard, at lessening intervals and progressively louder, the rumble and roll of thunder. In the pauses between I now became conscious of a low humming or buzzing which, like the thunder, grew momentarily louder and more distinct. It seemed to come from the body of the automaton, and was unmistakably a whirring of wheels. It gave me the impression of a disordered mechanism which had escaped the repressive and regulating action of some controlling part - an effect such as might be expected if a pawl should be jostled from the teeth of a ratchet-wheel. But before I had time for much conjecture as to its nature my attention was taken by the strange motions of the automaton itself. A slight but continuous convulsion appeared to have possession of it. In body and head it shook like a man with palsy or an ague chill, and the motion augmented every moment until the entire figure was in violent agitation. Suddenly it sprang to its feet and with a movement almost too quick for the eye to follow shot forward across table and chair, with both arms thrust forth to their full length - the posture and lunge of a diver. Moxon tried to throw himself backward out of reach, but he was too late: I saw the horrible thing’s hands close upon his throat, his own clutch its wrists. Then the table was overturned, the candle thrown to the floor and extinguished, and all was black dark. But the noise of the struggle was dreadfully distinct, and most terrible of all were the raucous, squawking sounds made by the strangled man’s efforts to breathe. Guided by the infernal hubbub, I sprang to the rescue of my friend, but had hardly taken a stride in the darkness when the whole room blazed with a blinding white light that burned into my brain and heart and memory a vivid picture of the combatants on the floor, Moxon underneath, his throat still in the clutch of those iron hands, his head forced backward, his eyes protruding, his mouth wide open and his tongue thrust out; and - horrible contrast! - upon the painted face of his assassin an expression of tranquil and profound thought, as in the solution of a problem in chess! This I observed, then all was blackness and silence.