"Hail fellow well met" is a somewhat archaic English idiom used when referring to a person whose behavior is hearty, friendly, and congenial.
The Oxford English Dictionary (OED) gives a 1589 quotation for this phrase as a friendly greeting, and quotations for the related phrase "hail fellow", a greeting that apparently dates to medieval times. "Well met" appears to have been added to the phrase in the 16th century to intensify its friendliness, and derives from the concept of "good to meet you", and also from the meaning of "meet" as something literally the right size for a given situation.
The expression appeared in Jonathan Swift's My Lady's Lamentation (1728).
The phrase appears in a section entitled "Sad"—in the Aeolus episode—in James Joyce's novel, Ulysses (1918), at the end of a description of the behaviour newspaper men: "Funny the way the newspaper men veer about when they get wind of a new opening. Weathercocks. Hot and cold in the same breath. Wouldn't know which to believe. One story good till you hear the next. Go for one another baldheaded in the papers and then all blows over. Hailfellow well met the next moment."
The early twentieth-century English novelist W. Somerset Maugham frequently used the term in his novels and short stories, in particular when he describes male characters of a genial, sociable, and hard-drinking temperament (e.g., Of Human Bondage,The Trembling of a Leaf, and Then and Now).
In modern English, the idiom is defined as "heartily friendly and congenial, comradely, hail-fellow—characteristic of or befitting a friend; 'friendly advice'; 'a friendly neighborhood'; 'the only friendly person here'; 'a friendly host and hostess'." As such, the idiom is used as an exaggerated greeting, or as a description of a personality type. Hence, modern use of the term tends to be deliberately archaic, with overtones of over-familiarity in the person so described (almost always male), or as a deliberate, tongue in cheek term of endearment; in the latter case it heightens the effect of the greeting of an unexpected friend (as in "the only friendly person here"), or to communicate the idea of a friend in an otherwise unfriendly environment.