SAN FERNANDO DE HENARES, Spain (AP) — Spanish Prime Minister Mariano Rajoy told the country's National Court that he didn't know anything about the ruling Popular Party's accounting practices when a kickbacks-for-contracts scheme allegedly helped fund the party.

Wednesday's highly-anticipated hearing was the first time that a prime minister has appeared in court while holding office since Spain transitioned to democracy four decades ago.

Rajoy himself is not accused of wrongdoing, but the court called him to provide testimony as the party's vice secretary general until 2003, and its secretary general until 2004, when the illegal funding scheme was allegedly still operating.

"I never took care of the economic issues in the party. I was devoted to political activity," Rajoy told the three magistrates during the proceeding.

Businesspeople, elected officials and other Popular Party members, including two former treasurers, are among the 37 accused of bribery, money laundering and tax evasion in the "Gurtel case," named after the German translation for belt. The Spanish word for belt is also the last name of Francisco Correa, a businessman arrested in 2009 who is the key defendant in the case, considered one of the largest corruption scandals in the country's modern history.

Correa faces a 125-year prison sentence if found guilty of controlling the network of aides and companies that arranged free events for the party in exchange for public contracts.

Rajoy arrived in a convoy Wednesday at the tightly secured National Court compound in San Fernando de Henares in the outskirts of Madrid.

Close by but out of Rajoy's sight, around 100 protesters held banners and shouted slogans like "Justice! Justice!" accusing the conservative party of covering up corruption. Some signs read "Mafia out, democracy in."

In an apparent attempt to underscore that he is a witness and not a defendant, Rajoy testified seated at a table on the stage at the same level as the three magistrates — not standing in front of them as is customary.

Rajoy repeated Wednesday what he had said earlier: that he never met Correa and he was the one, as party president in 2004, who ordered a halt to contracting with Correa's companies upon learning that they were misusing the conservative party's name.

The trial is part of a wider probe into illegal party funding reflected in hidden accounting kept by Luis Barcenas, the party treasurer for almost three decades.

In the most damaging allegations to date, Barcenas has said there was always a scheme of illegal contributions to the Popular Party and that top officials were aware. The party and Rajoy have denied his claims.

Rajoy called allegations that high-ranking party officials received illegal bonuses as "absolutely false." He explained that some received additional payments from the Popular Party to their salaries as legislators — money he said was taxed. He said those payments were halted as soon as any of the lawmakers took a position in the government.

As prime minister, Rajoy has made economic growth and job creation his chief goals since the party returned to power in 2011. In June, he won a no-confidence debate called against him by Podemos, a left-wing opposition party, because of the myriad of corruption scandals involving the Popular Party.