On Monday, a district court in Oslo sentenced Norway’s former top police official for organized crime to 21 years in prison for conspiracy to smuggle hashish. Eirik Jensen was arrested in 2014, after being secretly filmed in a meeting with Gjermund Cappelen, said to be Norway’s biggest hashish importer.

The two men were tried together.

The court found that Jensen had received 667,800 kroner (about $85,000) in bribes to protect Cappelen’s operations. Prosecutors said the total figure may have been 2.44 million kroner ($314 million), in exchange for allowing some 14 metric tons of hash to enter the country.

Cappelen got a reduced sentence of 15 years for testifying against his ex-protector. Jensen got the maximum sentence allowed by Norwegian law, according to Oslo’s the Local.

The court also heard testimony about the coded messages the two men texted each other, with the word “sunshine” used to indicate that Cappelen was not under police surveillance and could safely import his product.

Both men may appeal their convictions, but the affair is deeply embarrassing for the Scandinavian country, which is frequently named as one of the least corrupt on Earth. BBC News points out that Norway placed an impressive sixth in the 2016 global rankings by anti-corruption watchdog Transparency International. (The United States ranked 18.)