French astronomer Charles Messier accidentally discovered the Crab Nebula while looking for the Halley comet.

Although he wasn’t the first to document this discovery, this was the catalyst in his career and inspired the creation of the Messier Catalogue.

Source