TROY — A judge dropped all charges against a former city engineer and a current codes official in decision that rejected elements of the state attorney general’s handling of a probe into a 2015 land sale.

Rensselaer County Court Judge Jennifer Sober’s five-page decision, issued Monday, cleared Andrew Donovan, the former Troy engineer, and James Lance III, who returned to work at the codes office in September after a period of administrative leave that followed his arrest.

Sober ruled that the case, brought by attorney general’s Public Integrity Unit and led by Assistant Attorney General Bridget Holohan Scally, was factually and legally insufficient to support the indictments against the two.

Sober also concluded that prosecutors had improperly instructed the grand jury as it considered whether to bring certain charges against Lance. “The People ... instructed the Grand Jury to go back and continue to deliberate not once, but twice using an improper charge intended for a trial jury,” Sober wrote.

The grand jury ultimately indicted Donovan on six counts, and Lance on five.

Attorneys for both men said they had never seen a grand jury instructed in that way.

“The grand jury conduct by the attorney general’s office was troubling to read about," said attorney Marc Pallozzi, who represented Lance. “Unhappy with the results, it appears (Scally) forced the grand jury to vote three times."

“The attorney general’s office really doubled down on the allegations,” said attorney Mike McDermott, who represented Donovan.

Attorney General Letitia James' office did not return calls for comment.

Here's the full decision:

The attorney general's office launched an investigation after Republican members of the City Council filed a complaint after Times Union stories detailing Donovan's purchase and sale of a previously city-owned lot on Cemetery Road, Lansingburgh.

The council approved the $3,500 sale of the undeveloped land to Donovan in June 2015, and the deed went to the city codes department for an inspection. Lance did the inspection of the property at Donovan’s request. As part of the sale, the property had to meet city code within six months of the sale.

At the time he bought the property, Donovan indicated he planned to build a house on it. Donovan, who later put the land up for sale for $65,000 without making improvements to it, has since moved to Hawaii.

Prosecutors contended that Lance and Donovan improperly used their positions to clear the title and bypass a "reverter clause" designed to ensure that the new owner of a formerly city-controlled lot fulfills pledges to meet city code. Mayor Patrick Madden signed off on the cancellation of the reverter clause on the Cemetery Road property.

Prosecutors argued that Donovan had failed to meet the terms of the sale when he did not build anything on the land, and that the property was not properly cleaned and maintained.

Attorneys for Lance and Donovan argued that there had been no violation of the reverter clause because building code requirements apply only to properties that have existing structures on them.

Sober agreed, and said in her decision the theory behind the prosecution’s argument was flawed.

According to the decision, the terms of the sale gave Donovan a year to build on the property and six months to meet city codes before the reverter clause would have allowed the city to take back the land.

The sale closed in June 2015 and the property was inspected in September of that year — which meant Donovan’s timeline to meet the sale conditions had not expired, Sober wrote.

“It is important to note that the People failed to even present to members of the grand jury any documentary evidence of the subject provisions of the Troy city code,” Sober wrote. “Accordingly ... there was no violation of same by either defendant and therefore, no corresponding criminal liability.”

Sober's decision concluded prosecutors gave the grand jury instructions that while “not patently coercive” were “legally incorrect” as they tried to get a stronger indictment.

The grand jury considered the case in early 2019, and heard testimony from Madden and other city officials.

Prosecutors became concerned after the grand jury foreman told prosecutors on Feb. 7 that they had voted to dismiss two of the original eight counts against Lance, but were deadlocked on the other five.

Six days later, after prosecutors read them instructions intended for a jury trial and presented more evidence, the grand jury voted to indict Lance on one count but remained tied on the additional counts.

Prosecutors then told the grand jury to go back and continue deliberations before dismissing them for the day. When deliberations resumed on Feb. 19, the grand jury voted to indict Lance on four more charges.

Donovan was charged with second-degree grand larceny as a public corruption crime; corrupting the government in the second-degree; defrauding the government; falsifying business records; offering a false instrument for filing and official misconduct — all felonies, with the exception of the official misconduct charge.

If he had been convicted on the top charge, Donovan could have faced up to 25 years in prison.

Lance was indicted of first-degree tampering with public records; offering a false instrument for filing; falsifying business records, fourth-degree criminal facilitation and official misconduct.

According to postings on two real estate websites, it does not appear that Donovan has been successful in his efforts to sell the property.