It is proved that the nth Stern polynomial Bₙ(t) in the sense of Klavžar, Milutinović and Petr [Adv. Appl. Math. 39 (2007)] is the numerator of a continued fraction of n terms. This generalizes a result of Graham, Knuth and Patashnik concerning the Stern sequence Bₙ(1). As an application, the degree of Bₙ(t) is expressed in terms of the binary expansion of n.