Former Scottish secretary Alistair Carmichael told a "Homeric catalogue of untruths" after launching an "unguided missile" in the form of a leaked memo, a court has been told.

Judges sitting at a special Election Court in Edinburgh were also told the Liberal Democrat MP cannot be seen as a reliable witness and that his evidence should be treated with "extreme caution".

The court further heard claims the Orkney and Shetland MP had "broken the 11th commandment: 'Thou shalt not get found out'."

The statements were made on the third day of the hearing in closing submissions by Jonathan Mitchell QC.

He is representing four of Mr Carmichael's constituents who are behind a court bid to oust Mr Carmichael from his seat. The case has been brought under the section of the Representation of the People Act 1983 which forbids people from making false statements about the character and conduct of an election candidate.

It comes after he admitted responsibility for the leaked memo written by a civil servant, which incorrectly claimed First Minister Nicola Sturgeon told the French ambassador that she would prefer to see David Cameron remain in Downing Street at May's general election.

The MP initially denied having prior knowledge of the memo leak, but following a Cabinet Office inquiry he later admitted he had allowed his special adviser Euan Roddin to release details of the document, which appeared in the Daily Telegraph towards the start of the election campaign on April 3.

Earlier this week, the court heard evidence from Mr Carmichael, during which he also admitted being "less than fully truthful" with the Cabinet Office probe initially.

Summing up his case, Mr Mitchell told the judges: "In my submission the court cannot accept Mr Carmichael as a reliable witness. It might be going further than one needs to to say that the court could not accept him as a credible witness. Nevertheless it was striking that his position as to his own credibility was that he accepted effectively that he had repeatedly lied on the matters in question."

The lawyer said the MP had told a "Homeric catalogue of untruths - untruths to Channel 4, the Daily Record, to his own political friends and allies, clearly to the civil service and the department of which he was head, to the inquiry, to the court in his statement of evidence".

He went on: "When he was asked why should you expect this court to believe anything you say, his answer was the naive and ingenuous one that of course now he was on oath.

"In my submission the court must take his evidence with, at its very best, extreme caution."

Mr Carmichael's position is that his actions were political and did not affect his re-election. But Mr Mitchell argued the actions were "personal".

He said two people had made the decision to "launch this unguided missile" - something he claimed distanced the leak from being a political position of the Liberal Democrat Party.

The QC said of Mr Carmichael: "The image which he seeks to present to the court is that he is putting his own reputation on the line for the good of his party. Ultimately he takes the hit on this, although as he said it never occurred to him that he'd get caught.

"Really in the event he has broken the 11th commandment - 'Thou shalt not get found out' - but clearly it never occurs to him at the time that he would."

Mr Carmichael's counsel, Roddy Dunlop QC, later urged the court to refuse the campaigners' petition and rule that the MP's election was not void.

In his closing submissions to the court, he said Mr Mitchell had made an "unfair attack" on Mr Carmichael's evidence.

He said the MP had given his evidence to the court "quite plainly in a candid manner" and had accepted a number of points against his own interests.

Mr Dunlop said at the heart of the case is an "allegation of criminality with swingeing sanctions attached to it".

As a result, he said the four petitioners must demonstrate their case beyond reasonable doubt - the standard of proof in criminal cases.

"A man is not to be convicted on an ambiguity," he told the judges.

The court heard the judges have to consider two questions: Did Mr Carmichael make a false statement about his role in the leak to affect the return of a candidate at the election, namely himself in the Orkney and Shetland constituency, and was the statement in relation to his personal character or conduct?

Mr Dunlop said the evidence made it clear that the leak was "political in its entirety".

"The leak was political. That means a false denial about involvement in the leak would be a false statement about a political matter," he told the court.

He added that the other side's position, that a lie impacts on a person's integrity, is "entirely fallacious and wrong in law".

He said: "It is not enough simply to point to falsehood. That ultimately is all the petitioners' case does, is to say 'it was a lie, it impacts on integrity'.

"That misses the point because the statute requires as a starting point that there be a false statement. Falsity is by then a given.

"One must go on and ask the further question: 'Does the false statement directly relate to personal character or conduct?' And to simply say 'because it was a lie, yes it does' is to create a circular situation which makes no sense."

The legal challenge is the first election petition brought in Scotland for 50 years. All the evidence in the current case has now been heard.

The two judges hearing the case, Lady Paton and Lord Matthews, will deliver their judgment to the House of Commons at a later date.