The sentence was handed down at the Malmö district court after the man was found with 1.2 kilos of cannabis stuffed into socks in a bag reports the Skånska Dagbladet newspaper.
He denied the charge, arguing that he had crossed the Öresund bridge to go shopping in Denmark, and celebrate getting his residency permit in Sweden in late October.
However, his story was undermined when the prosecutor revealed a surveillance video from Copenhagen train station which showed another man climbing aboard the train holding the bag.
The second man elected not to travel on the train and got off immediately - minus the bag. When the other man was picked up by the authorities he was discovered to be in possession of 1.2 kilos of cannabis in the bag concealed in socks
The local district court said they didn't believe the man's claim that he was unaware of the drugs, as it was such a large quantity of cannabis.
It was added in court that the drugs will be destroyed but that the man will get his socks back when he has served his sentence. The time he has spent in custody will be deducted from his seven-month stint behind bars.