A Toronto judge has acquitted an 89-year-old woman who refused to fill out the census because it’s processed using software from a U.S. military contractor.

Audrey Tobias was found not guilty of violating the Statistics Act for refusing to fill out the 2011 government survey.

During her trial, Tobias told the court that she has been a peace activist since serving with the Women's Royal Canadian Naval Service during the Second World War.

So she was “shocked,” she said, to learn that the Canadian census contract was given to Lockheed Martin, a U.S.-based security and aerospace company with a product portfolio that includes aircraft, vehicles and technology systems used by military forces worldwide.

Judge Ramez Khawly said Wednesday that the government’s decision to prosecute Tobias was a bad public relations move.

He rejected the argument that forcing Tobias to complete the census would violate her freedoms of conscience and expression under the Charter of Rights and Freedoms.

"It is not readily apparent that answering the short, biographical census questions amounts to forcing a message on Ms. Tobias," Khawly said.

However, Khawly said he had to acquit Tobias because there was reasonable doubt about her intent. After Tobias testified, Khawly said, he could not be certain that, after more than two years, she was able to accurately tell the court her intent in not filling out the census.

Tobias’s lawyer Peter Rosenthal told reporters outside court that he was surprised that the case would hinge on the “exact nuance of what she was thinking as she failed to fill out the form.”

"It's a very unusual ruling in my experience and opinion," he said."He wasn't criticizing her for being an older person with a lack of memory. I mean, everybody reframes things as you rethink something that happened a couple of years ago.”

Rosenthal also said that: “People didn’t expect that a little old lady like Audrey Tobias would give them such a fight and embarrass them as much as she has.”

Tobias said she was “grateful” for the judge’s decision.

She said her immediate reaction to the ruling was: “Oh, goodness gracious.”

Tobias, who faced up to three months in jail if she had been convicted, said she was willing to go to prison.

"I would have done whatever was necessary because I wasn't willing to fill it in," she told reporters.

“I was curious. I wonder what it would be like.”

Of the 3,700 Canadians who did not fill out the census, Statistics Canada put forward 53 names to the Department of Justice for prosecution, court heard.

Khawly said the department made a mistake in prosecuting an elderly “model citizen.”

"Could they not have found a more palatable profile to prosecute as a test case?" Khawly said.

"I mean, really, could the defence have scripted anything better for their cause? Did no one at Justice clue in that on a public relations perspective, this was an unmitigated disaster? Are they that myopic that they could not see the train wreck ahead?"

Asked whether the case against her was “mean-spirited,” Tobias said she respected the Crown for laying out its position “very carefully and methodically.”

She said she was satisfied with the court proceedings and glad that her story made headlines.

“I think it is a significant issue for Canadians,” she said of foreign company involvement in census contracts.

“Maybe people will know now what our government is about.”

With a report from CTV Toronto’s Austin Delaney and files from The Canadian Press