Protesters gathered in front of the courthouse on the outskirts of Madrid as Rajoy, who is in his second term in power at the helm of a minority government, arrives to take the stand at 10:00 a.m. (0800 GMT).
The court appearance will be embarrassing for Rajoy, who has sought to distance himself from a series of corruption scandals that have for years surrounded his party, in power since 2011.
It will be the first time that an acting prime minister has appeared in court.
Two former premiers – Felipe Gonzalez, an ex-Socialist leader, and Adolfo Suarez, prime minister during the Spain's transition to democracy – appeared in court in separate trials but they were no longer in office.
Rajoy, 62, had asked to testify by video-conference but Spain's High Court ruled he must appear in person.
READ MORE: Rajoy still unscathed from corruption scandals
The trial at a court in San Fernando de Henares, near Madrid, centres on a vast kickback scheme that allegedly saw companies shower former PP lawmakers and civil servants with bribes in exchange for contracts.
While he is not accused of anything, Rajoy's post as party chief since 2004 – and as a high-ranking member before that – means he could provide valuable testimony.
The affair and other graft scandals have fuelled noisy street protests against the government and contributed to the PP losing its absolute majority in 2015 elections.
Rajoy's court appearance comes as Catalonia is ramping up its independence drive, with Catalan authorities pushing to hold a referendum on secession on October 1st which Madrid says is illegal.
Teneo Intelligence analyst Antonio Barroso said “the political impact of Rajoy's testimony will be limited” because Catalonia's referendum plans are “currently dominating the political agenda”.
“Nevertheless corruption issues will continue to put a ceiling on the PP's electoral aspirations,” he added.
The leader of the main opposition Socialists, Pedro Sanchez, said Rajoy's court appearance would be a “morally painful institutional image for Spaniards”.
Rajoy will not only answer questions in court, “he is also going to submit to a polygraph test in the form of the gaze of 46 million Spaniards,” Sanchez said Saturday.
Public prosecutors are not to expected to question Rajoy as they came out against his appearance, judging it unnecessary.
But their recommendation was overruled by judges who decided the prime minister should testify.
Instead the ADADE lawyers' association, a civil plaintiff in the case, will question Rajoy on Wednesday about his knowledge as a long-time high-ranking PP member.
Javier Maroto, a leading PP figure, said Rajoy would fulfil his obligations and “do everything in his hands” to help the court when he takes the stand.
Altogether, 37 defendants face justice in the case including two former party treasurers and businessman Francisco Correa, the alleged head of the network.
READ MORE: Spain's ex-party treasurer tells court of slush fund
Companies would allegedly give him a commission of two to three percent on the value of public contracts.
Correa said in court that he would then give politicians involved in awarding contracts some of the money.
His main accomplice was allegedly Luis Barcenas, a former PP manager and treasurer who was once close to Rajoy.
By Alvaro Villalobos / AFP
READ ALSO: Ten Spanish corruption scandals that will take your breath away