PHOENIX - A Phoenix man suspected of killing his wife, two daughters and another man confessed to the crimes after his arrest, claiming God told him it was OK to do so, according to Maricopa County court records.

The suspect has been identified as Austin Smith, 30, of Phoenix, according to police.

The killing spree began on Thursday around 8 p.m., at a home in the 7100 block of West Minnezona Avenue, when Smith confronted his wife after she arrived home from a local bar, according to Maricopa County court records.

The account of what happened was told to investigators by Smith, who confessed to the killings after his arrest, according to a probable cause-statement submitted to the court by Phoenix police after Smith's arrest.

Smith suspected the woman was having an affair, which she denied, but Smith "shot her because he believed God told him to do so,'' the statement says.

After killing his wife, identified as Dasia Patterson, 29, Smith turned his attention to one of his three daughters.

Murder rattles city:College student found with throat slashed at park near campus

California mom killed:Man kills mother of his child during custody exchange outside California police station

According to the court record, Smith believed his middle child, 5-year-old Nasha Smith, had "exhibited bad behavior'' against God's law, so he laid her on top of his wife's body and then shot the girl in the back of the head.

Smith then killed his 7-year-old daughter, Mayan Smith, because she was crying over what happened, according to the court record.

"Austin believed you should not weep for the wicked, so he punched her in the face several times with a closed fist, threw her up into the ceiling, and threw her down to the floor several times," police said in the document.

Officials said Mayan tried to escape, but Smith grabbed her and forced her to stay, believing God told him to kill her as well.

According to the court document, Smith "took a baseball bat and struck the child's head several times,'' killing her.

Jury:Mothers drugged, killed all six children by driving SUV over California cliff into ocean

'This man took my daughter':South Carolina men jailed for alleged murder of two women

Smith told police that his deceased daughters reminded him of his wife, whom he considered wicked in the eyes of God, the court record says. He did not harm his youngest daughter, who is 3, because "she reminded him of himself," police said.

Smith then drove to his brother's apartment in the 3600 block of North 39th Avenue, just south of Indian School Road. There, Smith made contact with a family friend, confronting him with his belief that Austin's brother was involved in an affair with his wife.

The man "told Austin he was crazy." Officials say Smith then shot the family friend numerous times with a handgun, killing him. He then fired at others who attempted to help him, whom he believed were co-conspirators in the affair, according to the court record.

Officers arrived at the apartment at 8:18 p.m. after reports of gunshots fired, according to Phoenix police.

"When they arrived, they continued to hear shots fired," said Phoenix police Sgt. Tommy Thompson.

Dennis Day:Body found at home of missing original Disney Mouseketeer Dennis Day

Thomas Burchard slaying:Two more suspects accused in slaying of California psychiatrist who was found in car trunk

Police arrived to find a man dead at the scene, identified as Ron Freeman, 46.

Two other people were also shot and wounded at the apartment. A 47-year-old woman was shot multiple times and was in critical condition Friday. Also shot was a 33-year-old man who was in serious condition.

As police were locating victims, a vehicle left the scene, police said. The vehicle was stopped by police at 67th Avenue and Osborn Road, and Smith was taken into custody.

It was only after police spoke to witnesses at the 39th Avenue address that they discovered the crime scene on Minnezona.

Smith was booked into a Maricopa County jail on four counts of first-degree murder, one count of attempted first degree murder and three counts of aggravated assault, Phoenix police said Friday afternoon.

Smith is being held on $2 million bail. His preliminary hearing is scheduled for April 22.

Follow Mike Cruz, Ali Phillips and Austin Westfall on Twitter: @mikecnews, @Ali_Phillips1 and @WestfallAustin