Omar Mateen was a bodybuilder and a security guard, a religious man who attended the local mosque and wanted to become a police officer.
But early on Sunday, the 29-year-old opened fire at a gay nightclub in Orlando, Florida, in an attack that left 50 people dead and 53 others wounded, police said.
Mateen was the son of an Afghan immigrant who had a talk show in the United States, the nature of which was not entirely clear. A former Afghan official said the programme was pro-Taliban and a former colleague said it was enthusiastically pro-American.
Mateen attended evening prayer services at the city's Islamic Centre three to four times a week, most recently with his young son, said Imam Syed Shafeeq Rahman. Although he was not very social, he also showed no signs of violence, Mr Rahman added. He said he last saw Mateen on Friday.
"When he finished prayer he would just leave," Mr Rahman told the Associated Press. "He would not socialise with anybody. He would be quiet. He would be very peaceful."
He was also bipolar, Mateen's ex-wife, Sitora Yusufiy, told reporters in Boulder, Colorado.
"He was mentally unstable and mentally ill," she said.
Although records show the couple did not divorce for two years after the marriage, Ms Yusiufiy said she was actually only with Mateen for four months because he was abusive. She said he would not let her speak to her family and that relatives had to come and literally pull her out of his arms.
Authorities immediately began investigating whether Sunday's attack was an act of terrorism. A law enforcement official said the gunman made a 911 call from the nightclub professing allegiance to the leader of Islamic State, Abu Bakr al-Baghdadi.
Ms Yusufiy said she was "devastated, shocked, started shaking and crying" when she heard about the shooting, but she attributed the violence to Mateen's mental illness, not any alliance with terrorist groups.
Imam Rahman agreed.
"My personal opinion is that this has nothing to do with Isis," he said.
The gunman's father, Seddique Mir Mateen, is a life insurance salesman who started a group in 2010 called Durand Jirga Inc, according to Qasim Tarin, a businessman from California who was a Durand Jirga board member. The name refers to the Durand line, the long disputed border between Afghanistan and Pakistan.
Mr Tarin said Seddique Mir Mateen had a television show on which they discussed issues facing Afghanistan.
"It's shocking," he said of the shooting. "(Omar Mateen's) father loves this country."
Some of Seddique Mir Mateen's shows were taped and later posted on YouTube. During one episode, a sign in the background read: "Long live the USA! Long live Afghanistan ... Afghans are the best friends to the USA."
But a former Afghan official said the Durand Jirga Show appears on Payam-e-Afghan, a California-based channel which supports ethnic solidarity with the Afghan Taliban, who are mostly Pashtun.
Viewers from Pashtun communities in the United States regularly call in to the channel to espouse support for Pashtun domination of Afghanistan over the nation's minorities, including Hazaras, Tajiks and Uzbeks, the official said.
The Durand Jirga Show expresses support for the Taliban, has an anti-Pakistan slant, complains about foreigners in Afghanistan and criticises US actions there, the official said.
Seddique Mir Mateen lavished praise on current Afghan President Ashraf Ghani when he appeared on the show in January 2014, but he has since denounced the Ghani government, according to the official, who said that, on Saturday, the presenter appeared on the show dressed in military fatigues and used his programme to criticise the current Afghan government.
He also announced on that show that he would run in the next Afghan presidential election, said the official.
In 2013, Omar Mateen made inflammatory comments to co-workers, and he was interviewed twice, FBI agent Ronald Hopper said. He called those interviews inconclusive. In 2014, Mr Hopper said, officials found that Mateen had ties to an American suicide bomber. He described the contact as minimal, saying it did not constitute a threat at the time.
Mateen purchased at least two firearms legally within the last week or so, according to Trevor Velinor, of the Bureau of Alcohol, Tobacco and Firearms.
Mateen had no criminal record. Ms Yusufiy said he wanted to be a police officer and had applied to the police academy. Mateen was a security guard at the G4S company, which identifies itself on its website as "the leading global integrated security company".
Imam Rahman said he had known Mateen and his family since the gunman was a young boy.
Playful as a child, he became more serious as an adult, he said. He spoke both English and Farsi, and was into bodybuilding. He was not, as far as the imam could see, someone who would ever commit such a gruesome act of mass violence.
"It was totally unexpected," Mr Rahman said.