A Milwaukee man fatally shot his neighbor and fired at the man's son after they declined a drink before killing two other tenants of his apartment complex, according to a criminal complaint filed Thursday.

Dan Popp, 39, is charged with three counts of first-degree intentional homicide in the deaths of 40-year-old Jesus Manso-Perez, 36-year-old Phia Vue and 32-year-old Mai Vue, who were fatally shot Sunday. Popp is also charged with attempted first-degree intentional homicide after authorities say he shot at Manso-Perez's 18-year-old son.

Popp was arrested Sunday outside the four-unit complex where the shootings occurred and made his initial court appearance Thursday. His attorney, Christopher Hartley, requested a competency exam, which was granted. A court-ordered mental health examiner will determine if Popp understands the charges against him and is able to aid in his defense.

"I think that he is just entirely confused about everything, and I'm not sure he really even understands what's going on," Hartley said. "I think he has some significant mental health issues."

According to a criminal complaint, Manso-Perez and his son were walking by Popp's apartment on their way to do laundry when he offered them beer, which they declined. Popp asked them where they're from, and they replied Puerto Rico, according to the complaint.

The complaint says Manso-Perez and his son continued to the basement and started a washing machine, and as they went up the stairs back to their apartment, Popp stood over them and had a rifle. The son told police Popp pointed the gun at his father, said, "You guys got to go," and shot him, according to the complaint.

Phia and Mai Vue, their four children and an adult relative hid in a bedroom after hearing gunshots, the complaint says. They heard pounding on their apartment door and Mai Vue gave the relative a cellphone to call police, according to the complaint.

Popp kicked down the front door and made his way to the bedroom, pointing a rifle at Phia Vue and ordering him to leave, according to the complaint.

The complaint says the family heard gunshots, and officers later found Phia Vue dead in a bathroom.

Popp came back to the bedroom and began to drag Mai Vue and two young daughters out of the apartment, according to the complaint. Mai Vue was found shot to death in Popp's apartment.

After police arrived, the complaint says Popp walked out of the building with a rifle slung over his shoulder that he dropped after officers yelled at him to do so. The complaint says officers ordered him to the ground and arrested him.

Popp remained in custody Thursday at the Milwaukee County Jail.