Former Calgary mayoral candidate and council gadfly Larry Heather has failed to have Mayor Naheed Nenshi kicked out of office.

On Tuesday, the Alberta Court of Appeal dismissed Heather's appeal of the 2017 municipal election after he challenged its legality.

Heather relied on a 1877 Supreme Court of Canada decision in his arguments.

That 142-year-old decision overturned the results of the 1876 federal election in a Quebec riding after the Supreme Court ruled a group of priests had "exercised undue influence on voters."

The priests had told their congregations ahead of polling day that those who voted for a particular candidate "would be guilty of a grave sin."

"Heather contends that in a modern municipality, the influence that can be exercised over voters by an incumbent mayor is the 'functional equivalent' of that wielded power by the parish priests," reads the appeal decision.

Heather first filed an application in the Court of Queen's Bench but the superior court rejected that notice and Heather took his cause to the province's top court.

Calgary's 2017 mayoral election had 10 candidates, including the following (clockwise from top left): Larry Heather, Naheed Nenshi, Bill Smith, Andre Chabot, Emile Gabriel and David Lapp. (CBC)

He argued the incumbent mayor intimidated voters through videos posted on social media and through radio interviews with a primarily Punjabi Sikh audience.

During those interviews and videos, Nenshi made comments that there were forces trying to "get people out who don't believe in diversity ... to get people who might be racists or haters out to vote."

Had Heather been successful in his appeal, the 2017 election results would have been declared void and a new vote would take place.

City council routinely sees Heather show up to meetings.

Nenshi has previously accused Heather of "unbelievable racism and hatred."

Heather finished seventh out of a field of 10 mayoral candidates in 2017. He received 845 votes — less than one per cent. Nenshi received 199,122 votes, which was 51 per cent of votes cast.

In recent years, Heather attended a Calgary Pride parade protesting "GSA fornication clubs" in reference to gay-straight alliances.

In 2016, Heather was kicked out of a council meeting.