They became Facebook friends, filling each other’s in-boxes with requests to join their networks, these young men from rival gangs who called the Brooklyn neighborhood of East New York their turf.

Accepting a friend request is an innocent click of the mouse for most, but for these men, it was like pulling a trigger.

They drew closer on the Web only to stoke violence in the streets, taunting one another on their Facebook pages, boasting about murders and keeping score, and posting photographs of themselves in front of the homes of their enemies, as if to say, “I know where you live.”

This is the strange world that Charles J. Hynes, the Brooklyn district attorney, and Raymond W. Kelly, the city’s police commissioner, described on Wednesday as they announced the indictments of 49 members of two gangs, called the Rockstarz and the Very Crispy Gangsters, also known as VCG/Weez. The charges included murder, attempted murder and conspiracy.