Nomad, a 21st-century Earth probe merged with an alien machine, sterilized whole worlds as imperfect until Kirk convinced it that it had erred and it destroyed itself.
Nomad was launched from Earth in the early 21st century by Jackson Roykirk to look for life beyond the Solar System. It was damaged and merged with an alien probe called Tan Ru, whose task was to sterilize soil samples. The combined machine took on a new mission to destroy anything imperfect and killed the billions of people of the Malurian system.
In 2267 Nomad came aboard the Enterprise, mistaking Kirk for its creator Roykirk. It killed Scott, then restored him, and erased Uhura's memory. Kirk pointed out that it had wrongly identified him as its creator and so was flawed itself. Unable to accept its error, Nomad was beamed into space and exploded.