Police believe that the man who killed three Iranian musicians in their Bushwick apartment building Monday morning before turning the gun on himself was angry that he had been excluded from his former band and the tight-knit group of Iranian artists living in Brooklyn.

Two members of The Yellow Dogs, brothers Soroush Farazmand, 27, and Arash Farazmand, 28, were killed in the shooting. The suspected gunman, Ali Akbar Mohammadi Rafie, had once played bass in The Free Keys, another Iranian band that along with The Yellow Dogs had been part of the "small but crazy" underground rock scene in Tehran.

Suspect Ali Akbar Mohammadi Rafie (Facebook)

Rafie got a work visa, and his band followed The Yellow Dogs to the United States, staying in the same apartment when they both arrived in 2011. NYPD spokesman John McCarthy told the Times that The Free Keys had kicked him out of the band last year over allegations that he had stolen money. "He's upset that he's not in the band," McCarthy said.

A police source told the Daily News, “He’d been trying to get back into the band. He’d been showing up at shows to try to convince them to let him back in.”

They refused. Police say that early Monday morning Rafie placed an assault rifle in a guitar case and climbed across several roofs to access The Yellow Dogs' apartment at 318 Maujer Street, accessing a third floor landing where he shot and killed 35-year-old Ali Eskandarian through a window. Eskandarian, a musician and writer who played as a solo artist and with other bands, lived above The Yellow Dogs.

Authorities say Rafie then climbed into the building's second floor and shot the band's drummer, Arash Farazmand, in his bedroom, before locating his brother, Soroush, killing him while typed on his laptop. Soroush was a guitarist for The Yellow Dogs.

Resident Sasan Sadeghpourosko, 22, was hit in the arm by a bullet fired down a hallway and into his shoulder, police said, before Rafie located Pooya Hosseini, a guitarist and vocalist for The Free Keys, who had been hiding in a closet.

McCarthy said that Hosseini was "begging for his life" and trying to "convince him not to shoot," when the gun went off. Hosseini then struggled with Rafie for the weapon, and a clip fell off. Rafie fled to the roof, where he shot himself in the head.

A couple who were both members of the U.S. Coast Guard who had been renting a room on the third floor hid in the bathtub, unharmed.

NYPD Commissioner Ray Kelly said the .308 caliber assault weapon used in the attack was purchased before 2006 from a dealer in Rockland County.

The Yellow Dogs had been playing increasingly better shows, and many believed that a record deal was imminent.

“Everyone knows it’s only a matter of time and the Yellow Dogs are going to be huge,” Ghanaian musician Ishmael Osekre, who had booked The Yellow Dogs before, told the Times. "That is why my heart is so broken—the idea that you left friends and family and love, and then for it to end in the way that it has, is just so unfair.”

The band's two surviving members, who hadn't been in the apartment complex during the shooting, bassist ‪Koroush‬ Mirzaei, and singer/rhythm guitarist, Siavash Karampour, posted a message on their Facebook page: