Eric Stauffer, 51, of the populist Geneva Citizens Movement (MCG), videotaped the transaction, which took place in 2013 in Geneva's Pâquis neighbourhood, and notified police who arrested the dealer and seized the drugs.
The video was put on the MCG's website, drawing the ire of Geneva's attorney general, Olivier Jornot, who fined Stauffer 2,500 francs on top of a suspended sentence equivalent to 45 days in prison payable by a penalty of 230 francs a day.
“The fact that the cocaine acquired was neither destined for consumption nor resale does not remove the punishable nature of the act,” Jornot stated in a criminal ordinance.
Stauffer's goal “was not to eliminate a health risk for others by removing narcotics from the market, but to entrap a dealer for the purposes of political propaganda.”
The MP's motivations were only for “political ambition in contempt of the law in force,” Jornot added.
The attorney general did not appear in court.
Stauffer told the judge his demonstration showed the “ineffectiveness of authorities in their fight against the trafficking of narcotics”, the Tribune de Genève reported.
But the MP said at no moment did he imagine that he was breaking the law and could be convicted.
He said it was his goal as an elected official to stem drug trafficking.
His lawyer, Yaël Hayat, called for Stauffer's acquittal, arguing that he should not be punished for a “fictional” crime, according to the Tribune de Genève.
Hayat noted that for a long time Geneva authorities had renounced convicting drug users who acquired small amounts (such as 2.2 grams) for personal use.
“Why was Eric Stauffer sanctioned?” she asked.
The lawyer argued that Stauffer's actions had public utility and political goals but the two were not contradictory.
The lawyer of the young MCG member caught with Stauffer also argued for his client's acquittal.
The court will rule on the case at a later date.
The affair is the latest tangle with authorities for Stauffer, who has been expelled from the Geneva parliament several times and was implicated in a scuffle with another MP in 2011.
He is one of two MCG candidates to represent Geneva in the national senate (council of states) in Bern.