Trent Kelley wondered how he could study the history of African-American gay men when so many of them had lived their lives in relative secrecy. He found his answer in vintage photographs — which he began to collect on eBay, at flea markets and at estate sales — which depict everything from urban dandies and workers to athletes and soldiers.

Then what?

Eager to share this findings and thoughts, he set up a Flickr stream he titled “Hidden in the Open: Photographic Essay of Afro American Male Affections,” which featured some 200 photographs from the Civil War to the present, an essay and romantic snapshots of contemporary black gay couples, men Mr. Kelley contrasts as being “out in the open.”

The early portraits, most from the late 19th and early 20th centuries, reflect the broader African-American embrace of photography as a powerful means of self-representation that defied withering stereotypes.

“Historically, the Afro-American gay male and couple have largely been defined by everyone but themselves,” wrote Mr. Kelley, a playwright in Texas. “Afro-American gay men are ignored into nonexistence in parts of black culture and are basically second-class citizens in gay culture.”

Photo

The path to social acceptance for African-American gay men has been fraught. While the black church led the struggle for equality and justice, Mr. Kelley notes that it also often denied its gay members those very same ideals. And the wider gay rights movement, for many years dominated by middle-class whites, has harbored biases against men and women of color.

But “Hidden in the Open” testifies to the existence of a historic and thriving black gay culture, one that was neither monolithic nor dependent on white people. It challenges the patronizing view of the besieged African-American gay man, shunned by his own community and inevitably reliant on white men for companionship and self-expression. Such stereotypes ignore the depth of white homophobia as well as the presence of tolerated gay subcultures within the African-American community.

The affectionate pairings featured in “Hidden in the Open” also challenge modern discomfort with male intimacy, sexual or otherwise. Even as American public opinion today is largely supportive of gay equality and same-sex marriage, the idea of male intimacy can still fuel uneasiness and homophobia.

This discomfort was not always the case. In his book “Dear Friends: American Photographs of Men Together, 1840 to 1918” (Harry N. Abrams), the art historian David Deitcher wrote that the introduction of photography in the United States in the mid-19th century coincided with “a surprisingly broadminded attitude toward same-sex intimacy.” Close, even passionate, bonds of friendship with members of one’s own sex were accepted and even encouraged.

Public displays of male closeness flourished during this time. As Mr. Deitcher observes, such intimacy was evident in all-male bastions of middle-class privilege, like universities, as well as socioeconomically diverse milieus, like the military, fraternal organizations, and big cities where millions migrated from farms and small towns in search of work.

This historical context makes the nature of some of the relationships depicted in “Hidden in the Open” uncertain and ambiguous, as Mr. Kelley acknowledges: “Not every gesture articulated between men was an indication of male-to-male intimacies. Assuredly, what all photographs in this essay have in common are signs of Afro American male friendship, affection, and love that were recorded for posterity without fear and shame.”

Photo

These quiet photographs underscore a poignant irony about masculinity: while emotional intimacy can be difficult for men, the capacity for us to bond in ways fraternal and nonsexual is profound. And with attitudes about homosexuality rapidly changing, these connections are increasingly evident across sexualities, with men of different orientations sharing platonic friendships based on a common masculinity, not sexuality.

If such bonds have been important to all men, they have been crucial for men of color. The alliances between African-American men — as well as with their female counterparts — were historically a matter of survival, a means of uniting against the forces of slavery, segregation and racism.

Yet, discussions of photographs of male intimacy have typically focused on white men. Of the more than 100 examples in “Dear Friends,” for example, only a few feature men of color. “Hidden in the Open” corrects this by exploring how race informs historic images of men together.

Essex Hemphill, the poet and activist, compared the pain he experienced as a closeted young black man with a kind of exile imposed both from without and within. He wrote of the agony of not being true to himself. The black gay man who passes as straight, he observed, “cannot honestly occupy the spaces of family and friendship because he has adopted — out of insecurity, defense, and fear — the mask of the invisible man.”

“Hidden in the Open” peels away the mask of this invisibility, liberating the story of black men together from the constraints imposed on it by history, by culture and by the men themselves.

In so doing, it attests to the power of photography to bring to light men who, because of who they were, remained hidden in plain sight.

Photo

Maurice Berger is a research professor and the chief curator at the Center for Art, Design and Visual Culture at the University of Maryland, Baltimore County, and a consulting curator at the Jewish Museum in New York.

Follow @MauriceBerger and @nytimesphoto on Twitter. Lens is also on Facebook.