The controversial federal prosecutor, Erwin Beyeler, has failed to win re-election by parliament.
The rightwing Swiss People’s Party had called for Beyeler not to be confirmed for a second term in office, while the Greens officially abstained in the ballot.
The People’s Party accused Beyeler of mishandling a case against a private banker and of covering up a plot against a former justice minister in 2007.
The other parties however argued it made no sense to change the head of the prosecutor’s office and destabilise the federal judiciary.
It was the first time in Swiss history that parliament rather than cabinet had the final say in the election of the prosecutor.
swissinfo.ch and agencies