THOUSAND OAKS, Calif. (AP) — The gunman who killed 12 people at a country music bar in Southern California went on social media during the attack and posted about his mental state and whether people would believe he was sane, a law enforcement official said Friday.

Also, one of the possibilities investigators are looking into is whether gunman Ian David Long believed his former girlfriend would be at the bar, the official said.

Authorities have not determined a motive for Wednesday night's rampage at the Borderline Bar and Grill.

The official was briefed on the investigation but not authorized to discuss it publicly and spoke to The Associated Press on condition of anonymity. The official would not give additional details on what the 28-year-old former Marine posted on his Facebook and Instagram accounts.

This 2017 photo from the California Department of Motor Vehicles shows Ian David Long. Authorities said the Marine combat veteran opened fire Wednesday evening, Nov. 7, 2018, at a country music bar in Southern California, killing multiple people before apparently taking his own life. (California Department of Motor Vehicles via AP) (AP)

Long, a former machine gunner who served in Afghanistan, opened fire with a handgun during college night at the bar, then apparently killed himself as scores of police officers closed in.

As investigators worked to figure out what set him off, President Donald Trump blamed mental illness, describing the gunman as "a very sick puppy" who had "a lot of problems."

Investigators have not commented on whether mental illness played a role in the rampage. But a mental health specialist who assessed Long after sheriff's deputies responded to a call about his agitated behavior last spring worried he might be suffering from post-traumatic stress disorder.

A bouquet of flowers, left by mourners, lays near the site of Wednesday's mass shooting, in Thousand Oaks, Calif., Friday, Nov. 9, 2018. Investigators continue to work to figure out why an ex-Marine opened fire Wednesday evening inside a Southern California country music bar, killing multiple people. (AP Photo/Damian Dovarganes) (AP)

The incident happened in April, when yelling and loud banging noises coming from the home Long shared with his mother prompted a next-door neighbor to call authorities. The mental health specialist concluded there were no grounds to have him involuntarily committed.

Several people who knew Long a decade ago as a high-schooler in the suburb of Thousand Oaks said in interviews that he made them uncomfortable, sometimes through aggressive behavior.

At the White House, Trump touted his efforts to fund work on PTSD among veterans. He declined to engage on questions on whether the nation needs stricter gun control laws.

Police block the entrance to the parking lot leading to the Borderline Bar & Grill in Thousand Oaks, Calif., Thursday, Nov. 8, 2018. A gunman opened fire Wednesday evening inside a country music bar, killing multiple people. Terrified patrons hurled barstools through windows to escape or threw their bodies protectively on top of friends as a Marine combat veteran killed multiple people at a country music bar in an attack that added Thousand Oaks to the tragic roster of American cities traumatized by mass shootings.(AP Photo/Damian Dovarganes) (AP)

The dead in the shooting rampage included sheriff's Sgt. Ron Helus, a 29-year veteran gunned down as he entered the bar, and Telemachus Orfanos, 27, who survived last year's massacre in Las Vegas, where a gunman in a high-rise hotel opened killed 58 people at an outdoor country music festival.

Authorities in Thousand Oaks described an attack of military efficiency. None of those injured was hurt by gunfire, authorities said. Instead, when Long shot, he killed.

"Every Marine is trained in urban warfare and indoor gun fighting," said Marc Bender, an instructor for emergency responders in Riverside County, California. "Every Marine is a marksman."

FBI investigators join law enforcement as they work near the scene of Wednesday's shooting in Thousand Oaks, Calif., Friday, Nov. 9, 2018. Investigators continue to work to figure out why an ex-Marine opened fire Wednesday evening inside a country music bar, killing multiple people. (AP Photo/Damian Dovarganes) (AP)

Julie Hanson, who lives next door to the Longs' ranch-style home, described him as "odd" and "disrespectful" well before he left home a decade ago, got married and enlisted in the Marines. She could often hear him yelling and cursing, but several months ago, unusually loud banging and shouting prompted her husband to call authorities.

"I was concerned because I knew he had been in the military," Tom Hanson said.

About 18 months ago, Don and Effie MacLeod heard "an awful argument" and what he believes was a gunshot from the Longs' property. Don MacLeod said he did not call police but avoided speaking with Ian Long.

Dominique Colell, who coached girls' track and field at the high school where Long was a sprinter, remembers an angry young man who could be verbally and physically combative.

People gather to pray for the victims of the mass shooting during a candlelight vigil in Thousand Oaks , Calif., Thursday, Nov. 8, 2018. A gunman opened fire Wednesday evening inside a country music bar, killing multiple people. (AP Photo/Ringo H.W. Chiu) (AP)

In one instance, Colell said Long used his fingers to mimic shooting her in the back of the head as she talked to another athlete. In another, he grabbed her rear and midsection after she refused to return a cellphone he said was his.

"I literally feared for myself around him," Colell said in an interview. "He was the only athlete that I was scared of."

Colell said she wanted to kick Long off the team but the boy's coach urged her to reconsider because that could compromise his goal of joining the Marines. She relented when, at the next track meet, Long apologized in front of several coaches and administrators.

A picture of Noel Sparks is seen during a candlelight vigil in Thousand Oaks, Calif., Thursday, Nov. 8, 2018. A gunman opened fire Wednesday evening inside a country music bar, killing multiple people. (AP Photo/Ringo H.W. Chiu) (AP)

Attempts to get comment by phone and in person from officials at Newbury Park High School and its school district were unsuccessful. Both were closed due to a destructive wildfire in the area.