The prime spectrum of the semigroup algebra K[S] of a submonoid S of a finitely generated nilpotent group is studied via the spectra of the monoid S and of the group algebra K[G] of the group G of fractions of S. It is shown that the classical Krull dimension of K[S] is equal to the Hirsch length of the group G provided that G is nilpotent of class two. This uses the fact that prime ideals of S are completely prime. An infinite family of prime ideals of a submonoid of a free nilpotent group of class three with two generators which are not completely prime is constructed. They lead to prime ideals of the corresponding algebra. Prime ideals of the monoid of all upper triangular n × n matrices with non-negative integer entries are described and it follows that they are completely prime and finite in number.