The word had started to acquire associations of immorality by 1637 and was used in the late 17th century with the meaning "addicted to pleasures and dissipations." This was by extension from the primary meaning of "carefree": implying "uninhibited by moral constraints." A "gay woman" was a prostitute, a "gay man" a womanizer and a "gay house" a brothel.

The use of "gay" to mean "homosexual" was in origin merely an extension of the word's sexualised connotation of "carefree and uninhibited", which implied a willingness to disregard conventional or respectable sexual mores. Such usage is documented as early as the 1920s, and there is evidence for it before the 20th century, although it was initially more commonly used to imply heterosexually unconstrained lifestyles, as in the once-common phrase "gay Lothario", or in the title of the book and film "The Gay Falcon" (1941), which concerns a womanizing detective whose first name is "Gay." Well into the mid 20th century a middle-aged bachelor could be described as "gay", indicating that he was unattached and therefore free, without any implication of homosexuality. This usage could apply to women too. The British comic strip "Jane" was first published in the 1930s and described the adventures of "Jane Gay". Far from implying homosexuality, it referred to her free-wheeling lifestyle with plenty of boyfriends (while also punning on Lady Jane Grey).

A passage from Gertrude Stein's "Miss Furr & Miss Skeene" (1922) is possibly the first traceable published use of the word to refer to a homosexual relationship. According to Linda Wagner-Martin ("Favored Strangers: Gertrude Stein and her Family" (1995)) the portrait, "featured the sly repetition of the word gay, used with sexual intent for one of the first times in linguistic history," and Edmund Wilson (1951, quoted by James Mellow in "Charmed Circle" (1974)) agreed. For example:

The 1929 musical "Bitter Sweet" by Noël Coward contains another use of the word in a context that strongly implies homosexuality. In the song "Green Carnation", four overdressed, 1890s dandies sing:

The song title alludes to Oscar Wilde, who famously wore a green carnation, and whose homosexuality was well known. However, the phrase "gay nineties" was already well-established as an epithet for the decade (a film entitled "The Gay Nineties; or, The Unfaithful Husband" was released in the same year). The song also drew on familiar satires on Wilde and Aestheticism dating back to Gilbert and Sullivan's "Patience" (1881). Because of its continuation of these public usages and conventions in a mainstream musical the precise connotations of the word in this context remain ambiguous.

Other usages at this date involve some of the same ambiguity as Coward's lyrics. "Bringing Up Baby" (1938) was the first film to use the word "gay" in apparent reference to homosexuality. In a scene where Cary Grant's clothes have been sent to the cleaners, he must wear a lady's feathery robe. When another character inquires about his clothes, he responds "Because I just went gay...all of a sudden!" However, since this was a mainstream film at a time when the use of the word to refer to homosexuality would still be unfamiliar to most film-goers, the line can also be interpreted to mean "I just decided to do something frivolous." There is much debate about what Grant meant with the ad-lib (the line was not in the script).
The word continued to be used with the dominant meaning of "carefree", as evidenced by the title of "The Gay Divorcee" (1934), a musical film about a heterosexual couple. It was originally to be called ""The Gay Divorce"" after the play on which it was based, but the Hays Office determined that while a divorcee may be gay, it would be unseemly to allow a divorce to appear so.

Gay community vs LGBT community
Overview
Homosexuality
Sexualization