The Connecticut woman who was shot to death outside the U.S. Capitol after trying to ram her car through a White House barrier had been under the delusion the president was communicating with her, a federal law enforcement official said Friday.

The woman’s mother said she had been suffering from postpartum depression.

Miriam Carey’s killing at the hands of police Thursday was Washington’s second major spasm of deadly violence involving an apparently unstable person in 2½ weeks.

Interviews with some of those who knew the 34-year-old woman suggested she was coming apart well before she loaded her 1-year-old daughter into the car for the drive to Washington.

Carey had suffered a head injury in a fall and had been fired as a dental hygienist, according to her former employer.

The federal law enforcement official, who had been briefed about the investigation but was not authorized to discuss it publicly and spoke on condition of anonymity, said investigators have been interviewing Carey’s family about her mental state and examining writings found in her Stamford condominium.

“We are seeing serious degradation in her mental health, certainly within the last 10 months, since December, ups and downs,” the official said. “Our working theory is her mental health was a significant driver in her unexpected presence in D.C. yesterday.”

The woman had made delusional “expressions about the president in the past” and believed President Barack Obama was communicating to her, the official said.

“Those communications were, of course, in her head,” the official said, adding that concerns about her mental health were reported in the last year to Stamford police.

Stamford Police Chief Jonathan Fontneau said his officers had gone to Carey’s home in the past, but not in response to any crime. He gave no details.

The federal official said investigators believe that she drove straight to the nation’s capital and that the violence unfolded immediately upon her arrival.

After ramming the barricades at the White House, the apparently unarmed Carey led police on a chase down Constitution Avenue to the Capitol, where she was shot in a harrowing chain of events that led to a brief lockdown of Congress. Carey’s daughter escaped serious injury and was taken into protective custody.

Carey’s neighbors in Stamford were shocked to learn the driver’s identity and see her gleaming black Infiniti wrecked outside the Capitol in TV footage.

Erin Jackson, her next-door neighbor on the building’s ground floor, said Carey doted on her daughter, Erica, often taking the girl on picnics.

“She was pleasant. She was very happy with her daughter, very proud of her daughter,” she said. “I just never would have anticipated this in a million years.”

Carey’s mother, Idella Carey, told ABC that her daughter began suffering from postpartum depression after giving birth in August 2012.

“She was depressed. … She was hospitalized,” said Idella Carey, who said her daughter had no history of violence.

Dr. Brian Evans, a periodontist in Hamden, Conn., said Carey was fired from her job at his office about a year ago. He would not say why. He said Carey had been away from the job for a period after falling down a staircase and suffering a head injury, and it was a few weeks after she returned to work that she was fired.

“We’re shocked to know this happened and we feel saddened for her family and all those involved,” he said.

On Sept. 16, a man killed 12 people in a shooting rampage at the Washington Navy Yard before dying in a gun battle with police.

The gunman, Aaron Alexis, a defense-industry employee and former Navy Reservist, had complained of hearing voices and said in writings left behind that he was driven to kill by months of bombardment with electromagnetic waves.

Carey had been sued by her condominium association for failure to pay fees, court records show. A lawsuit settled in February alleged that she owed the association $1,759 plus collection costs.