Image caption The Scottish Sun has shifted support from Labour to the SNP in recent years

Media mogul Rupert Murdoch has said that if the Scots edition of the Sun had not supported the SNP then he would have faced a revolt in Scotland.

He made the comment during his first day of evidence to the Leveson Inquiry into media ethics.

Robert Jay QC was quizzing the News Corporation chairman about why the Sun had gone from anti to pro-SNP.

Mr Murdoch added his relationship with the SNP leader Alex Salmond was warm, but he did not know much about the SNP.

The Leveson Inquiry, which is being held at the Royal Courts of Justice in London, has for a second day heard about the Murdoch organisation's relationship with the SNP government and Mr Salmond.

I can only tell you as a matter of interest that if we didn't continue to support Mr Salmond at this stage, I really would have had an insurrection up there Rupert Murdoch, Chairman of News Corp

On Tuesday, Mr Murdoch's son James Murdoch discussed emails in which it was revealed that Mr Salmond's adviser - named as Geoff Aberdein - had agreed that the first minister would call Culture Secretary Jeremy Hunt "whenever we need him to".

Tory MP Mr Hunt was given the quasi-legal job of deciding the fate of BSkyB - which News Corp wanted to take full control of.

On Wednesday, Mr Murdoch senior was in the hot seat when the issue of the news media's relationship with the SNP and its leader was raised.

Towards the end of the afternoon session, the 81-year-old was asked by inquiry lawyer Mr Jay why the Scottish Sun was anti-SNP at the 2007 Holyrood election but by 2010 had swung behind Mr Salmond and his party.

Mr Murdoch said his organisation had not done any deal with Mr Salmond, although he said that on a personal level he liked the first minister.

Mr Jay said to the inquiry that the Sun in Scotland was;

pro-SNP in 1992

anti-SNP in 2007

and pro-SNP from 2010 onwards

Image caption Rupert Murdoch was giving his first day of evidence to the Leveson inquiry

The lawyer went on to ask Mr Murdoch to describe his relationship with Mr Salmond and the SNP.

The Australian told the inquiry: "I don't know Mr Salmond well, but I've had three meetings here and he is an amusing guy and I enjoy his company and I enjoy talking with him and listening to him."

Mr Jay then quoted a letter of congratulations from David Dinsmore, general manager of News International Scotland, which was sent to Mr Salmond following his party's historic victory at the 2011 Holyrood election.

It read: "I look forward to News International playing its part in helping to make the country a place where outward looking, forward thinking and risk taking is the norm."

Mr Jay put it to Mr Murdoch that his organisation now had an ally in Scotland.

Mr Murdoch told the lawyer: "Well, Mr Dinsmore may have gone a little too far in his enthusiasm. I can only tell you as a matter of interest that if we didn't continue to support Mr Salmond at this stage, I really would have had an insurrection up there."