SAN JOSE — A widely-viewed violent home-invasion robbery in a tony Evergreen subdivision last month was actually a setup “masterminded” by the homeowner’s 17-year-old son who enlisted three gang members he knew from school, prosecutors alleged Friday.

The three teens, son included, have been charged as adults in the crime, which was partially captured on home surveillance the family had installed after a previous burglary. The high-definition video was posted on this newspaper’s website, as well as other media outlets and social media.

Facing felony first-degree robbery and burglary charges, along with gang enhancements, are Simerjeet Singh, Moses Perez Herrera, 17; Alvaro Valdivia, 16; and Moses Noel Torres, 22. All four were in custody Friday. Torres is being held in lieu of $250,000 bail. Herrera and Valdivia are being held in lieu of $210,000.

Singh was arraigned Friday in a San Jose courtroom, clad in a green sweater, while his father — whose house was burglarized — and other relatives looked on from the gallery. None was willing to comment after the brief hearing.

Defense attorney Ginny Walia requested that Singh be granted reduced bail and eventual release on his own recognizance, owing to his strong area ties and the presence of relatives willing to supervise him. Prosecutor Madeline Seiff rebuffed this argument, citing the severity of the charges and contending that Singh “essentially masterminded this whole plan.”

Judge Deborah A. Ryan sided with Seiff when setting Singh’s bail at $200,000.

If they are convicted, Valdivia and Herrera face a maximum penalty of 22 years each; Torres and Singh, 20 years and eight months.

“This was very serious conduct. Extremely dangerous,” Seiff said. “The sad part about this is he turned on his own family.”

Authorities say Singh did not live at the home — his father’s — that was targeted in the home invasion. A motive for the purported scheme remains unclear.

“We’re still looking into what exactly motivated him to set this whole thing up,” Seiff said.

Police caught a break in the case when one of the teenagers caught on video turned himself in five days after the Friday morning home invasion. Seiff said “sources close to the case” implicated Singh, but declined to provide further details.

Prosecutors allege Herrera and Valdivia were driven to Singh’s house on Shiloh Place about 11 a.m. on May 8 by Torres.

Herrera and Valdivia, who was wearing a hood and gloves, allegedly broke in through an unlocked sliding door.

The defendants then armed themselves with kitchen utensils, severed telephone land lines and stole a cell phone on the first floor. When they went upstairs, they were confronted by a female resident, who thought the noises may have been created by her husband. She took a 14-month-old girl they were watching — Singh’s half-sister — and ran into another room.

The two defendants ran after her, smashing through a door the victim was desperately trying to hold closed, according to the District Attorney’s Office. The three then fled that room and locked themselves into a bathroom. As the victims called for police on a cell phone, the defendants unsuccessfully tried to get in, prompting the burglars to leave.

Seiff said the trauma that Singh and his alleged accomplices inflicted on his family can’t be understated.

“The women were hesitant to open the door when San Jose police arrived,” she said.

Contact Tracey Kaplan at tkaplan@mercurynews.com. Contact Robert Salonga at rsalonga@mercurynews.com.