The Prime Minister of Spain, Mariano Rajoy, appeared in court as a witness on Wednesday morning, in an ongoing corruption investigation involving the illegal funding of his party, the Popular Party, several years ago when he was a minister under José María Aznar.

For two hours, Mr. Rajoy repeated before the court and lawyers that "I don't know", "I have absolutely no idea", or "I never knew anything about that", when probed on his involvement in the funding scheme under investigation.

The prime minister arrived by car to the back door of the court building and sat beside the judge and at the same level as the court, instead of in the normal witness position in front of and below the bench.

Asked if he ever took off-the-books cash stuffed in envelopes while serving as a minister under Mr. Aznar, Mr. Rajoy replied: "never ever, that would be illegal".

He said he had never had any accounting responsibility within the party and did not recall knowing or meeting most of the cast of characters from those years he was asked about by lawyers.

The presiding judge ruled many of the lawyers' questions inadmissible, as protestors chanted outside the court.

To the question of what happened after he sent an infamous text message to the party's then treasurer, Luis Bárcenas, promising him that he would call him "tomorrow", Mr. Rajoy replied that he had never made the call, nor spoken again to Mr. Bárcenas.

"I did absolutely nothing [to benefit Mr. Bárcenas]".

The leader of the Spanish Socialist Party (PSOE), Pedro Sánchez, called on Mr. Rajoy to "resign this morning before the King", so that the country and Spaniards might save face.

"Unfortunately, today, July 26, is a black day in the history of our democracy. For the first time, a serving prime minister has had to sit before a court to testify in a corruption case involving his party", he added.

Podemos leader Pablo Iglesias said: "The impertinence and insolence with which Rajoy talks to citizens is shameful".

State broadcaster TVE, Spain's equivalent of the BBC, was criticised for showing the prime minister's testimony on a secondary channel instead of the main one. Private broadcasters gave his remarks full coverage.

The leader of the Socialist Party did not specify what he will do next if—as is foreseeable—Mr. Rajoy does not resign by lunchtime.