The house on 36th Avenue is seen where two University of Maryland students died in a murder-suicide and a third suffered gunshot injuries on Tuesday. (Bonnie Jo Mount/The Washington Post)

Dayvon Green began to behave in bizarre ways in recent weeks. He accused his housemates in College Park of hacking his computer, and at one point, they got into a fistfight, according to a close friend of one in the group. Green bought a semiautomatic rifle less than a month ago.

Stephen Rane confided in the friend that he and other housemates had confronted the increasingly agitated University of Maryland graduate student. They knew that Green had guns, Rane told the friend, and they were concerned about that and his overall demeanor.

“He seemed reasonable about it,” Rane said, according to a Jan. 30 Facebook conversation log. “So I think I might not die.”

On Tuesday, Green set several small fires in and around his house and then shot and killed Rane, a 22-year-old English major at U-Md. He also wounded another housemate before walking to the back of the home, where he killed himself.

Police said Wednesday that the wounded student was released from a hospital. An aunt and a cousin said Neal Oa, 22, of Frederick, Md., was recovering and declined to comment further. Friends said that Green, Rane and Oa didn’t know one another well, if at all, before they began leasing rooms at the house. They were the only ones home at the time of the shooting.

The incident has left police — and those who knew Green — searching for answers as to how a young man who showed so much promise could have fallen so rapidly. Former professors remembered Green, 23, as an average or above-average student who worked hard. He helped write an academic paper for a prominent engineering conference when he was an undergraduate at Morgan State University, they said. He dreamed of becoming a professor.

“I’m still shocked because I can’t believe that Dayvon is capable of doing that, but who knows?” said Madhumi Mitra, a biology and environmental sciences professor at the University of Maryland Eastern Shore, who worked with Green during a summer research project in 2009. “The mind is very complex.”

The house where Green’s parents live in the Baltimore suburb of Rosedale remained virtually sealed Wednesday, its mailbox filling with notes from reporters. No one answered the door, and family members did not return multiple phone messages.

Rane’s family did not return calls, either, and a young man at the door of his family’s home in Silver Spring turned away a reporter. Carl S. Perkins, the principal at Howard County’s Centennial High School, said Rane was a 2009 graduate and was interested in music.

“He was a very nice kid,” Perkins said. “He kept to himself, yet he had lots of friends.”

Police said Green’s relatives told detectives that he suffered from some type of mental illness for about a year, and he took medication for his condition. Law enforcement officials, speaking on the condition of anonymity to candidly discuss the ongoing investigation, said family members thought he had schizophrenia, though detectives were probing the diagnosis and medication.

For the past year, the officials said, Green’s mental health seemed to deteriorate. But outward signs were scattered. University officials said Green never sought mental health treatment on campus.

From Aug. 28 to Sept. 11, he worked for the campus police department as a police aide — passing a background check to do so. He eventually was fired for missing two consecutive shifts. Campus Police Chief David Mitchell said his department received no reports that Green might be a threat.

Cindi Infiesto said her son, Adam Infiesto, lived in the home until October, when he was deployed overseas by the military. She said her son told her that those who lived there “were all good guys,” with whom he had become “fast friends.”

“He never could have saw this coming” and he “doesn’t understand why this guy killed” his housemate, Infiesto said.

Mitra, the professor, said she saw Green at a presentation in 2012. “He looked very happy and relaxed,” she said. “And he said he’s enjoying his graduate school at College Park.”

Xavier Henry, a PhD student at the University of Maryland Eastern Shore who served as a sort of mentor to Green, said he “was the one that kind of helped keep everybody together.”

Inside Green’s off-campus home on 36th Avenue in College Park, though, trouble brewed.

Jeanette Santori, 21, a senior computer science and math major at the University of Maryland Baltimore County, was close with Rane. She said Green was “unhinged.” She said he would tell housemates — without any context — that he was going to “dip out to Las Vegas,” and he advised them to get lawyers after he accused them of hacking his computer. At some point, she said, the housemates learned that Green was keeping weapons in his room.

Another friend, Drew Needham, 21, said Rane would sometimes spend the night at friends’ homes because he was worried about Green.

“It wasn’t expected, but there were definitely indicators that the roommate was not stable,” Needham said.

Police recovered two firearms from Green after the shooting — a 9mm handgun and a .22-caliber Uzi B rifle, both of which he purchased legally. They said he used the handgun in the shooting, and investigators recovered the fully loaded Uzi — along with ammunition, a baseball bat and a machete — in a shoulder bag he was carrying.

The rifle was not used, and investigators did not find a suicide note or plans for more violence.

Santori said the housemates never complained to police, seemingly because they were cautious about interaction with authority.

Still, she said, “I absolutely think it was preventable. It shouldn’t have happened.”

When Green moved in — and how well he knew those he lived with — remained a matter of debate Wednesday. Santori said she thought the date was a few weeks ago; the landlord said it was in September.

That landlord, Bradlee Bolino, said he never received any complaints about Green. He said that like the others in the house, Green had his own lease, and he was unsure if Green was friends with others in the house before moving in.

“It’s a horrible tragedy,” Bolino said. “It just turns your stomach.”

Peter Hermann and Jennifer Jenkins contributed to this report.