Image caption Alex Salmond referred himself for investigation

An inquiry has cleared the first minister of breaching the ministerial code over a row about an independent Scotland's status in the EU.

Alex Salmond referred himself for investigation by the principal of Reading University, Sir David Bell.

The academic said Mr Salmond was right to seek EU legal advice only after the referendum deal was signed.

However, Labour highlighted a part of the report that said Mr Salmond's explanations were "muddled".

The inquiry was launched following complaints from Labour MEP Catherine Stihler that Mr Salmond had misled the public over the existence of legal advice to back up the Scottish government's position that an independent Scotland would be a member of the EU.

Sir David's report said there had been no suggestion that the Scottish government had sought to "mislead deliberately".

However, he concluded that the part of the code relating to legal advice be revised to provide clearer guidance.

Timeline - EU advice row May 2011 - Labour MEP Catherine Stihler asks if the Scottish government has legal advice on an independent Scotland in Europe

- Labour MEP Catherine Stihler asks if the Scottish government has legal advice on an independent Scotland in Europe August 2011 - The government refuses to reveal if it has advice

- The government refuses to reveal if it has advice October 2011 - Ms Stihler writes to Information Commissioner Rosemary Agnew saying she is not happy with that refusal

- Ms Stihler writes to Information Commissioner Rosemary Agnew saying she is not happy with that refusal July 2012 - Ms Agnew says ministers should reveal if they have advice. The government continues to say it cannot because it would breach the ministerial code to do so

- Ms Agnew says ministers should reveal if they have advice. The government continues to say it cannot because it would breach the ministerial code to do so September 2012 - A court date in December is set to settle the matter

- A court date in December is set to settle the matter October 23, 2012 - Nicola Sturgeon tells MSPs that ministers did not have legal advice on the EU but it was now commissioning advice from the Lord Advocate Frank Mulholland. She adds that the court case on the matter is dropped

- Nicola Sturgeon tells MSPs that ministers did not have legal advice on the EU but it was now commissioning advice from the Lord Advocate Frank Mulholland. She adds that the court case on the matter is dropped October 25, 2012 - Independent investigators will look into whether the first minister breached the ministerial code in relation to the legal row

- Independent investigators will look into whether the first minister breached the ministerial code in relation to the legal row January 10, 2013 - The first minister is cleared of breaching the ministerial code. But Sir David Bell - the man tasked with investigating Alex Salmond - said the ministerial code should be clearer on the issue of legal advice. Find out more detail

Ms Stihler said she found it "strange" that Sir David believed Mr Salmond was correct to wait until the Edinburgh Agreement before seeking legal advice on Scotland's place in the European Union.

"That looks like more of a post event alibi than a real reasoning," she suggested.

"The truth is the first minister said he didn't need the section 30 order, which he now calls the Edinburgh Agreement. When the UK government first proposed such an agreement, he suggested it was an affront to Scottish democracy.

"Alex Salmond has re-written history on this one and Sir David appears to have fallen for it."

The 50-page ministerial code details the rules to which the first minister, his ministers and members of the Scottish Parliament must abide.

It says that anyone knowingly misleading Holyrood is expected to offer their resignation.

Mr Salmond welcomed the report and thanked Sir David for his "very thorough and detailed" work.

"This has been the sixth complaint to be referred to the independent panel of advisers I introduced in 2008 to rule on these matters," said the first minister.

"I am delighted that each complaint has been dismissed and the advisers concluded my ministers and I have acted entirely properly at all times."

But Scottish Conservative leader Ruth Davidson said Sir David's inquiry was a "sham process".

"This whole system needs to be looked at," she said. "Never again should the first minister be able to orchestrate his own inquiry into his own wrongdoing.

"Mr Salmond might think this puts him in the clear, but actually he comes out of it with even less credibility than he had before."