File image of Spanish Prime Minister Mariano Rajoy during a party event in Madrid, Spain, on Apr. 10, 2017.

Spain's national court on Tuesday decided to call on the country's prime minister to testify as a witness in a sprawling corruption case involving his party.

Prime Minister Mariano Rajoy is set to appear before the court to be questioned on prominent figures within the upper echelons of the conservative Popular Party who between 1999-2005 were linked to a corrupt network of businessmen and politicians that embezzled millions in public funds.

The decision to summon Rajoy was approved by a majority of the three judges who make up the tribunal.

The public prosecution had previously objected to the need for Rajoy's testimony, describing it as "unnecessary, dispensable and useless."