A screengrab from the live stream which was watched by millions of viewers. (PA)

More than four million people tuned in to watch a Supreme Court hearing about Boris Johnson’s controversial decision to prorogue Parliament.

According to The Guardian, the live stream on the court’s website was accessed 4.4 million times during the morning session.

And around 2.8 million stream requests were logged in the hour before the 1pm break for lunch.

Typically, the live streaming service is accessed about 20,000 times a month.

Businesswoman Gina Miller leaves the Supreme Court following the hearing on the legality of proroguing Parliament. (Getty)

On Tuesday the court heard Prime Minister Boris Johnson will comply with the Supreme Court’s ruling if it concludes his advice to the Queen to suspend Parliament for five weeks was unlawful.

Giving a legal undertaking on behalf of Mr Johnson, the Advocate General for Scotland, Lord Keen QC, said the Prime Minister will “take the necessary steps”.

However, he refused to rule out the possibility Mr Johnson may advise the Queen to prorogue Parliament for a second time.

Lord Keen made the comments on Tuesday during an exchange with Lord Kerr, one of 11 justices hearing appeals arising out of two separate challenges in England and Scotland over the legality of the prorogation – which resulted in different outcomes.

READ MORE FROM YAHOO NEWS UK:

When asked by Lord Kerr what would happen if the court rules that the prorogation was unlawful, and whether Parliament would be recalled, he replied: “It will be then for the Prime Minister to address the consequences of that declaration.”

Lord Keen added: “I have given a very clear undertaking that the Prime Minister will respond by all necessary means to any declaration that the … prorogation was effected by any unlawful advice that he may have given.”

When Lord Kerr asked if it could be taken that the prorogation decision could not be made a second time, Lord Keen replied: “I’m not in a position to comment on that.

Story continues

“That will have to be addressed by the decision maker.”

Lord Keen added: “If the court finds it was unlawful, the Prime Minister will take the necessary steps to comply with any declaration made by the court.”

Mr Johnson advised the Queen on August 28 to prorogue Parliament for five weeks and it was suspended on September 9.

The Prime Minister says the suspension is to allow the Government to set out a new legislative agenda in a Queen’s Speech when MPs return to Parliament on October 14.

But those challenging his decision argue that it is designed to prevent parliamentary scrutiny of the UK’s impending exit from the EU on October 31.

The Supreme Court justices are being asked to determine whether the Prime Minister’s advice to the Queen is “justiciable” – capable of challenge in the courts – and, if so, whether it was lawful.

The court will hear further submissions from the parties and the interveners on Wednesday and Thursday, but it is not clear when a ruling will be given.

Lawyers for the Prime Minister will outline his case that his advice on the suspension was lawful from 10.30am on Wednesday.