DeKalb Superior Court Judge Mark Anthony Scott on Thursday sentenced a woman to life in prison — ending a controversy that erupted when he allowed her to remain free after her conviction.

Pamela Ballin, 53, was before the judge to learn if he would override a jury verdict by either acquitting her or by declaring a mistrial in bludgeoning death of her husband Derrick “Ricky” Ballin.

Scott had shocked the public and the district attorney’s office in June when he allowed Ballin to remain free on bail until he decided whether to override the jury verdict — a highly unusual decision that made defense hopeful for an acquittal.

George “Mikey” Ballin credited the media attention for the judge’s life sentence without hearing any argument for a bench verdict of acquittal or mistrial Thursday as expected.

“When you have to run for election, this is what you have to do,” said Ballin, the victim’s brother.

Defense lawyer Keith Adams contended Pamela Ballin was tied directly to the killing by suspicion, not by evidence or motive. He also said a mistrial should have been declared after a crime scene investigator testified by Skype because she was on vacation.

After the ruling, Adams said the judge’s decision had left a number of “substantive” issues for appeal. George Ballin said he had confidence in the appellate court, noting about Adams: “during the trial he was pretty vocal, now he is pretty quiet.”

Derrick Ballin Jr. , the son of Ricky and Pamela, contended his mother was innocent of beating his father to death in their Lithonia home just after Christmas in 2009. Pamela said her husband was killed during a robbery while she cowered upstairs — a story police quickly came to doubt.

“It is a shame how people can sway somebody into believing what they want you to believe,” the son said, tearing up outside the DeKalb County courthouse.

The decision to allow Ballin to remain free had originally made Adams, a veteran litigator, cautiously optimistic the judge was troubled enough by the evidence that he might render an extraordinary decision to free her despite the jury verdict.

He noted the 2009 murder wasn’t indicted until 2013 because of the case’s weakness. He said much of the police investigation that had initially reported that Ballin killed her husband for $750,000 in life insurance money and because he planned to divorce her for her alleged infidelity had been rebuffed at trial.

The prosecution did not call the lead detective to testify at the trial because of problems with his testimony, Adams said.

The judge reversed his decision to allow Ballin to remain free when District Attorney Robert James asked the court to order her arrest, saying she might flee, possibly to Jamaica, the family homeland.

George Ballin, who flew in from New York for the hearing, noted his brother’s long marriage to Pamela had been troubled, and he had advised his brother to end it several years before his murder.

He described his bear of a brother as a very large “puppy dog” who had built a highly successful landscaping business. Hundreds of people had come to his funeral, including childhood friends from Jamaica.

“He was a good guy,” Ballin said. “If you slapped him, he would look up at you and laugh.”