In his home village Wollerau in the former world tennis number one got 132 votes to represent the canton of Schwytz in the Swiss senate.
A Facebook appeal urged voters to scratch out the listed candidates and write in Federer’s name.
An election official based in Schwytz, near Zurich, told AFP that write-in votes are permitted under Swiss law and that had the appeal been more successful, Federer could have won a senate seat.
“One could be elected here, even if one is not a candidate,” he said.
In Sunday’s vote, only one senate candidate in Schwytz earned the absolute majority needed to secure a first round win. The second-round vote to fill the second seat is set for the 27th of November.