The Black Knight was a robotic knight constructed by the planet computer of the Shore Leave Planet.
In 2267, drawn from McCoy's thoughts on Earth fairy tales, it represented the kind of threat he felt was appropriate to his role as Yeoman Barrows' protector. McCoy did not believe the knight was real, and so stood his ground when it charged him. It drove its lance through him, killing him instantly, or so it then appeared. When it circled to attack Kirk and Spock, Kirk shot it with a .38 police special, disabling it. Spock's tricorder readings revealed that the knight was like everything else of the planet – a multicellular casting, and not a real living being at all. During a brief interval when the landing party was distracted by an aircraft, the knight's body disappeared. (TOS: "Shore Leave")