A judge has declared a mistrial in former Massachusetts treasurer Tim Cahill's corruption case after jurors failed to reach a verdict during seven days of deliberations.

Cahill was accused of scheming to run $1.5 million in taxpayer-funded ads for the state lottery as a means of promoting his sinking 2010 campaign for governor.

Cahill testified that he approved the advertising blitz because he wanted to defend the lottery after the Republican Governors Association ran a series of negative ads attacking him and his management of the lottery.

Former chief of staff Scott Campbell was acquitted in the case Tuesday. The judge said Wednesday that she was confident jurors had deliberated thoroughly and tried to reach a verdict in Cahill's case.

Cahill's defense attorney will appear on WGBH's Greater Boston on Dec. 12 at 7 p.m. to discuss the judge's verdict.