Sami languages
In Proto-Samic, the common ancestor of the Sami languages, there was already a contrast between single and geminate consonants, inherited from Proto-Uralic. A process called consonant gradation then lengthened all consonants when they stood at the end of a stressed syllable, if the next syllable was open. The subsequent loss of final consonants and vowels in the later Sami languages made this process contrastive, resulting in as many as four contrastive lengths (lengthened geminate, unlengthened geminate, lengthened single, unlengthened single). The modern Sami languages have reduced this to three, by merging the unlengthened geminates with the lengthened single consonants.