ELLSWORTH, Maine — A veterinarian committed no crime when she bought land for less than it was worth from a man suffering from dementia, a judge ruled Tuesday.

Judge Michael P. Roberts rejected prosecutors’ arguments that Dr. Kathleen Prunier had stolen from friend Richard Royal when he sold her 5.27 of his 10 acres on Trenton’s Southwest Point for $4,000 in 2014.

The Maine Attorney General’s Office charged Prunier with theft by unauthorized taking, a Class B crime, to combat a chronic and growing Maine problem — financial exploitation of the elderly, Assistant Attorney General Leanne Robbin said.

But its case was undercut by differing estimates of the land’s value — $7,900 to $75,000 — and medical testimony that Royal was legitimately capable of deciding whether to sell his land, Roberts said.

“Mr. Royal had a mild cognitive impairment,” Roberts said Tuesday. “He needed assistance, but was capable of making decisions.”

Prosecutors faced a difficult challenge in taking what is typically a civil-court case into criminal court, where standards of proof are much higher, Robbin said.

Prunier got relief but no happiness from the verdict. Publicity surrounding the case helped torpedo the 59-year-old Trenton woman’s veterinary practice and cost her a book deal, she said.

It also compounded the loss of a friend. A U.S. Navy veteran and retired state worker, Royal died on July 11 at age 85.

“I loved Dick deeply,” Prunier said. Stealing from him “was not even an option. I would not. I could not.”

Prunier is being sued in civil court by Royal’s family. That case is pending, a Hancock County court clerk said.