Montel Williams just got a lesson in German law -- you can't fly with weed, unless you've got a serious medical condition ... which is how he avoided getting arrested.
Montel's rep tells us he was traveling through the Frankfurt airport with his wife early Friday, and got stopped by customs agents. They discovered marijuana in his carry-on which Montel uses to help treat his MS and detained him for questioning.
We're told Montel informed cops the pot was only medication and called his team back in the U.S. to send over proof of his prescription.
Williams' rep says once Montel presented the proof, the German authorities were cool with everything and let him go. He was held for less than an hour.
Montel's rep, Jon Franks, tells us, "Unfortunately this is the reality faced by medical marijuana patients every day all over the world. Today, Montel reaffirms his commitment to fighting for sensible medical marijuana policies across the world and to fighting the stigma he and so many other seriously ill Americans face every day for simply following the advice of their doctor."