Because of the similarity in form between the second element of the compound "nightmare" and the noun "mare" meaning "a female hrose," many people have assumed a connection between the two wrods, say editors at Merriam Webster Inc. Actually, howerver, the "mare" of "nightmare" is a survival of another "mare" found in Old English.
"Mare" was a word in English as early as the eighth century, but it was obsolete by the 18th century. Old English "mare" means "an evil spirit thought to oppress people during sleep." The compound "nightmare" first appears in Middle English in the 13th century in a sense much the same as "mare" in Old English. Not until the 16th century was the meaning of "nightmare" extended to refer to a frightening or oppressive dream, probrably from the beliefOor suggestion that such dreams were caused by evil spirits.Dream on.