A German Green party politician who poured a bucket of ice water over his head for charity has caused an stir online by slipping in a quiet call to legalise marijuana.

Party co-leader Cem Özdemir, 48, joined thousands worldwide when he doused himself in freezing water for an online video clip to raise awareness of the neurodegenerative Lou Gehrig's disease or ALS.

But unlike other public figures, Özdemir performed the stunt standing next to a potted cannabis plant on a Berlin rooftop balcony.

"It wasn't standing there by accident," Özdemir later admitted, saying he had wanted to add "a gentle political statement" in his contribution to the #IceBucketChallenge social-media sensation.

"Yes, it's a hemp plant," he told Bild on Thursday, confirming what countless internet commentators had already spotted, and often applauded, in their postings.

"We Greens are friends of liberty," Özdemir said. "Whether someone can consume cannabis and take the associated risks should be decided by the citizens themselves in a free society."

The online reaction was mixed, with some suspecting it was an oversight and others wondering whether Özdemir would be punished for the apparent illegal possession of a hemp plant.

Others greeted the pro-legalisation statement. On Twitter, @passagier404 said: "Özdemir proves that he doesn't just have balls but also nice marijuana".

One writer asked if there were any balconies in inner-city Berlin that did not have cannabis plants, while another simply quipped about Özdemir's environmentalist party that "they don't call 'em Greens for nothin".