The gunman who shot 12 people dead at a Virginia Beach municipal building had been facing disciplinary action for a violent fight at work, according to a report.

DeWayne Craddock, 40, was still employed as an engineer with the Department of Public Utilities when he went on his shooting rampage Friday, killing 12 and injuring several others, including a cop.

But he recently started showing serious behavioral problems and got into physical “scuffles” with other city workers, a source told the New York Times.

The source told the paper that the troubles had escalated in the week leading up to the mass shooting — and Craddock was involved in what it called “a violent altercation on city grounds.”

Craddock reportedly knew he was facing disciplinary action for the fight when he went into the municipal building with two .45-caliber handguns, at least one of which was equipped with a sound suppressor — and both of which were purchased legally.

Craddock killed 12 people, all but one co-workers, and injured several others before he died in a police shootout.

He launched the attack after brushing his teeth — and sharing pleasantries with a fellow engineer.

His family posted a handwritten note outside their Yorktown, Va., home, offering “heartfelt condolences to the victims,” according to the Washington Post.

“We are grieving the loss of our loved one. At this time we wish to focus on the victims and the lives loss [sic] during yesterdays tragic event,” the note said.

“Our thoughts and prayers are with the families of those who loss [sic] their lives, and those recovering in the hospital.”

“They’re beautiful people, both,” Betty Ware, a deaconess, said of Craddock’s parents, saying his mother would talk about their children “all the time.”

“She was just proud of them, her children,” Ware told the Washington Post.