EU president Donald Tusk on Wednesday testified for eight hours in Warsaw as a witness in an investigation of two former military counter-intelligence chiefs accused of overstepping their duties.
Speaking to reporters after the questioning, the former liberal Polish prime minister said: "This whole affair is extremely politically motivated."
Tusk, an arch-rival of Jaroslaw Kaczynski, the powerful leader of the conservative governing Law and Justice (PiS) party, had been summoned for closed-door questioning in March but was unable to appear because of a previous European Parliament commitment.
The original summons came days after EU leaders gave Tusk another term as president despite strong opposition from Poland, which cast the sole vote against him. An angry Warsaw accused the EU of "cheating".
Tusk warned that he would use his EU immunity if he came to the conclusion that the investigation was "deliberately used to make it more difficult or impossible for me to exercise my mandate as EU president."
"I hope it won't lead to that, but if it does, I won't hesitate."
The throngs of supporters who greeted Tusk at the train station on Wednesday morning referred to his EU re-election, chanting "27 to 1, Tusk beat Kaczynski".
Carrying European Union flags, they also chanted "We're with you, Donald" as they escorted him from the train station to the prosecutor's office.
His opponents, meanwhile, held up signs showing Tusk dressed as a prisoner.
"I am very critical of what's happening at the moment in our country, but everything rests in the hands of the people," Tusk told reporters after arriving in the Polish capital.
The probe centres on Generals Janusz Nosek and Piotr Pytel, who are suspected of having "overstepped their duties by collaborating with services of a foreign state" without authorisation.
According to Polish media reports, at issue is an agreement struck with Russia's FSB intelligence service -- the successor to the KGB -- shortly after a 2010 plane crash in Russia which killed Polish president Lech Kaczynski and scores of senior Polish officials.
Tusk was prime minister at the time.
Some reports suggest the agreement was aimed at cooperating on the withdrawal of Polish troops from NATO operations in Afghanistan at the time, while others say it allowed FSB agents to visit the headquarters of Poland's SKW military counter-intelligence agency unfettered.
Kaczynski has accused Tusk of "moral responsibility" for the death of his brother Lech in the plane crash.