THOUSAND OAKS, Calif. — 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's night rampage at the Borderline Bar & Grill.

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

Neither Facebook nor Instagram had any immediate comment.

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.

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.

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.

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 assault 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."

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.

"I told my wife, 'Just be polite to him. If he talks, just acknowledge him, don't go into conversation with him,'" Don MacLeod said.

Long made others feel uncomfortable going back to his teens.

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.

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 mid-section 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.

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.