The Young Men's Christian Association was founded on June 6, 1844 in London, England, to provide relief from unhealthy social conditions arising in big cities at the end of the Industrial Revolution (roughly 1750 to 1850).
The growth of the railroads and the centralization of commerce and industry in the cities brought many rural young men there hunting for jobs. These men often ended up working themselves brutally in order to make ends meet, often putting in ten to twelve hours a day, six days a week.
Having left their homes and families behind, these young men would often end up living where they worked. Many of them would sleep in crowded rooms over the company's shop, which at least were safer than London's tenements and streets. Crime was high in London at this time, with vagrants and thieves (and yes, whores) populating the Industrial district; the open sewers running here and there didn't do anything for the atmosphere either.
George Williams, a sales associate at a draper's shop (which apparently was more like a department store than a place selling frilly cloth window-hangings), started the first YMCA with other fellow drapers, in order to promote Bible study and prayer. George was not originally from the city himself, having been born on a farm in 1821.
The idea of the YMCA was unusual because it was non-denominational (within Christianity, that is) and non-classist, at a time in England when class and church lines were very divisive. Its founding purpose of easing social need in the community was likely part of the reason why the institution became so well received.
As an institution, the YMCA caught on quickly, with twenty-four of them in place throughout Britain by 1851. That same year, the Y also came to North America - one in Montreal on Nov 25th, and one in Boston on Dec 29th. By 1854, the year of the Ys first international convention, there were three hundred ninety-seven YMCAs established in seven countries, with a total membership in excess of thirty thousand. Membership in American Ys decreased sharply during the Civil War, down to about a third of its numbers previous to the start of the conflict.
By the end of the war, only fifty-nine YMCA establishments remained, but this number increased back up to six hundred after four years of rebuilding. For his service work, George Williams was knighted by Queen Victoria in 1894, and upon his death in 1905 he was honored by being laid to rest beneath St. Paul's Cathedral.