Shooter Ian Long was holding a gun in one hand and his phone in the other as he indiscriminately killed people inside the bar, law enforcement officials told TMZ.

As he carried out the shooting, he posted messages to his Instagram story in real time, the site reported.

Those videos remained up on Long's social media profile for hours after the shooting, before being discovered by police who asked Instagram to remove his account, according to the same report.

Thousand Oaks shooting: in pictures Show all 10 1 /10 Thousand Oaks shooting: in pictures Thousand Oaks shooting: in pictures Emergency services attend the scene AP Thousand Oaks shooting: in pictures People walk away from the scene EPA Thousand Oaks shooting: in pictures Emergency service vehicles flood the scene Reuters Thousand Oaks shooting: in pictures Police officers secure the road EPA Thousand Oaks shooting: in pictures Police block an intersection by the scene of the shooting AP Thousand Oaks shooting: in pictures A woman hugs with her father at the scene EPA Thousand Oaks shooting: in pictures Survivors are interviewed at the scene EPA Thousand Oaks shooting: in pictures Police officers interview people at the scene AFP/Getty Thousand Oaks shooting: in pictures People wait near the scene of the shooting AP Thousand Oaks shooting: in pictures People walk away from the scene of the shooting AP

Some of the messages may have indicated the shooting was the result of a grudge, it said.

Police continue to search for a motive or any clear understanding of why Long walked into the Borderline Bar and Grill late on Thursday and killed as many people as he could.

Videos from inside the venue showed a horrific scene as people fled the attack.