Key points:

Sitora Yusufiy, the former wife of suspect Omar Mateen, said he had trained with his friends, who were police officers, and had a licence to have a gun.

"He wanted to be a police officer. He applied to the police academy. He worked as a correctional officer or something at a juvenile delinquent centre so he was working up and gaining experience to become an officer," she said.

"He didn't practise in front of me but I'm sure he went to shooting ranges."

Ms Yusufiy said she had not had any contact with Mateen in years, after she left him in 2011 fearing for her life.

"I was with him for about four months. I stayed with him. Then my family rescued me and then started the process of divorce," she said.

"He was very short-tempered and he would often get into fights and arguments with his parents. But because I was the only one in his life, most of the violence was towards me at that time."

She described him as a "private person" but not especially expressive about his Muslim faith.

Mateen, 29, was a Muslim American of Afghan descent and US law enforcement is investigating whether he had links to — or was inspired by — Islamist terrorism.

"It has been reported that Mateen made calls to 911 this morning in which he stated his allegiance to the leader of the Islamic State," said Ronald Hopper, the FBI's assistant special agent in charge on the case.

But US officials cautioned that they had no conclusive evidence of any direct connection with Islamic State (IS) or any other foreign extremist group.

"We know enough to say this was an act of terror, an act of hate," President Barack Obama said in a speech from the White House.

"As Americans, we are united in grief, in outrage and in resolve to defend our people."

Mateen had twice been interviewed by FBI agents, in 2013 and 2014, after making comments to co-workers indicating he supported militant groups, but neither interview lead to evidence of criminal activity, Special Agent Hopper said.

Imam never expected this from Mateen

Mateen attended evening prayers three or four times a week at the Islamic Centre of Fort Pierce, bringing his son, who is about four or five years old, the mosque's imam said.

"He would pray and his son would play," said Syed Shafeeq Rahman, who met Mateen in 2003 when he became the imam.

Mateen did not socialise, leaving when services ended. He did not talk but would smile and shake hands, Mr Rahman said.

The imam said it was "unbelievable" that a heavily armed Mateen carried out a rampage at a gay club.

"I never expected this. We teach peace and justice," Mr Rahman said.

"It must be some kind of psychological problem or anger problem."

The imam said Mateen might have been radicalised on the internet.

Mateen's parents regularly attend services at the mosque and his father works in life insurance, the imam said.

Mr Rahman said he was concerned about the safety of the mosque, located on a quiet residential street in the small coastal city of Fort Pierce, saying "the people who are bad people look like us, and that's a problem".

Conflicting accounts of Mateen's 'anti-gay' attitude

Relatives interviewed by US media have said Mateen, who worked as a security officer, was not overly religious but had anti-gay views and had regularly assaulted his ex-wife.