Mike Duffy's lawyer ripped into Nigel Wright in court on Friday, accusing the prime minister's former chief of staff of planning to deceive Canadians with a scheme to secretly use a Conservative Party fund to pay off inappropriate living expenses claimed by the senator.

"You go secretly to the chair of the Conservative fund," Duffy's lawyer Donald Bayne said. "You use public funds and taxpayer donor funds secretly to arrange to have the fund pay it without telling Canadians. And you think that was principled and ethical to do?"

Wright replied that the appropriate thing to do was to repay the expenses.

"But not with the Conservative fund," Bayne shot back

"I thought that it was OK," Wright said.

Duffy has pleaded not guilty to 31 charges of fraud, breach of trust and bribery related to expenses he claimed in 2013 as a senator and later repaid with money he received from Wright. 

In February 2013, the Prime Minister's Office (PMO) had been attempting to squash the controversy that had arisen because Duffy, a P.E.I. senator, had claimed living expenses for his Ottawa residence, even though he spent most of his time in Canada's capital.

Although Wright has testified that Duffy may have done nothing legally wrong by making those claims, and that he may have been entitled to those claims, the general public would likely not have a similar view.

Members of the PMO, including Wright, wanted Duffy to agree to a deal in which he would admit he had made an unintentional mistake and say that he would repay the expenses, at the time thought to be $32,000. In turn, Conservative Senator Irving Gerstein, who was chair of the Conservative fund, had arranged with Wright that the fund would be used to secretly cover Duffy's expenses.

Bayne said that the objective of paying back the funds was strictly a political imperative.

"This was a secret political arrangement to make this political problem go away. And it was secret wasn't it," Bayne asked.

"The fact the Conservative fund was paying was secret," Wright agreed.

But Bayne continued to hammer away at the issue, asking if Wright didn't think the plan was a fraud on the public, on donors and on taxpayers who subsidize the fund.

"Don't you think that's a fraud on those people?" he asked Wright, who said he did not consider it a fraud.

The claiming of the expenses was inappropriate, but it was appropriate to pay them back, he said.

"Sir, you can order somebody to rob a bank to repay the money. That wouldn't be right would it?" Bayne asked.

The lawyer continued, asking Wright if this scheme was not a "deliberate deception on Canadians."

"I didn't think of it that way at the time. I just didn't think it was wrong," Wright said, adding it was his view that using the fund was appropriate.

On Feb. 22, Duffy went public about the expense controversy, telling CBC News that he "may have made a mistake" by claiming the housing allowance for his Ottawa home and saying he would be paying the expenses back.

But the deal went sour when it was learned Duffy's expenses actually totalled $90,000. Gerstein would no longer allow money from the fund to be used to cover the expenses. That's when Wright personally intervened with his own money, court has heard.

Earlier, court heard how Duffy continued to resist the plan to publicly admit he made a mistake with his living expenses claims and would agree to pay them, up until the day he made the admission.

Bayne told court his client had been forced to make that admission, even though he believed he had done nothing wrong.

Heated conversation

He said that Duffy was "hostile" to the agreement, noting a heated conversation he had with Wright about the issue on Feb. 20. 

At that point, part of the scenario put forth was that Duffy would make a public statement that he made an innocent mistake, that the expenses would be repaid and in return, a Senate steering committee would halt an external audit of his expenses.

Duffy Trial 20150813

Nigel Wright, former chief of staff to Prime Minister Stephen Harper, is testifying for a third day Friday at the Mike Duffy trial in Ottawa. (Justin Tang/Canadian Press)

"And Senator Duffy says 'no.' He's hostile to it. Still on the 20th," Bayne said. "On the 20th he's saying 'I'm not going to go along with this.' That's why this was forcing somebody to do this."

Wright again denied Duffy was forced, saying instead he persisted with the senator. Wright admitted that he was "pissed" Duffy was resistant to the plan, and that he had a heated telephone conversation with Duffy on the 20th. But, the next day, Duffy agreed to the plan.

Wright said that during February, there were days that Duffy agreed with the plan and days he didn't "which is why persistence was required."

But court also heard of an email sent by Duffy on Feb. 22 to Ray Novak, then Harper's principal secretary and currently his chief of staff.

"Ray, I am cooked. I did nothing wrong," Duffy wrote on Feb. 22, the same day he made his public admission.

Wright's third day of testimony comes on the 39th day of the judge-only trial, which resumed Wednesday after last sitting on June 18. It was the second hiatus of the high-profile trial, which began April 7 in the Ontario Court of Justice in Ottawa. This third phase will continue until Aug. 28, and, with more time assuredly needed, break until it would resume again in mid-November.

With files from The Canadian Press