This is of uncertain origin; perhaps originally "defender, protector," and from PIE root *ser- (1) "to watch over, protect" (seeobserve). Meaning "man who exhibits great bravery" in any course of action is from 1660s in English. Sense of "chief male character in a play, story, etc." first recorded 1690s. Hero-worship is from 1713 in reference to ancient cults and mysteries; of living men by 1830s.
In Homer, of the Greeks before Troy, then a comprehensive term used of warriors generally, also of all free men in the Heroic Age. In classical mythology at least from the time of Hesiod (8c. B.C.E.) "man born from a god and a mortal," especially one who had done service to mankind; with the exception of Heracles limited to local deities and patrons of cities.