Genetic programs, environmental factors, and electrical activity interact to drive the maturation of the brain. Although the cascade of transcription factors that leads to specification of the serotonergic phenotype has been well characterized, its interactions with electrical activity are not known. Here we show that spontaneous calcium spike activity in the hindbrain of developing Xenopus laevis larvae modulates the specification of serotonergic neurons via regulation of expression of the Lmx1b transcription factor. Activity acts downstream of Nkx2.2 but upstream of Lmx1b, leading to regulation of the serotonergic phenotype. Using global manipulation of activity and targeted alteration of Lmx1b expression, we also demonstrate that changes in the number of serotonergic neurons change larval swimming behavior. The results link activity-dependent regulation of a transcription factor to transmitter specification and altered behavior.