Spaniard David Shaves Perea, 27, this morning pleaded guilty to charges of importing 2.5 grams of cannabis and being in possession of drugs.
Police inspector Victor Aquilina told the court that the drug was for the personal use of the accused and was minimal.
Magistrate Antonio Micallef Trigona jailed the accused for six months suspended for a year.
In a separate case, Stephen Carminati, a 20-year-old Italian, pleaded guilty to being in possession of a minimal amount of cannabis and was given six months probation.
The two were arrested by the police at a party near Rabat early on Sunday.