We used high resolution micromechanical force sensors to study the in vivo mechanical response of embryonic Drosophila neurons. Our experiments show that Drosophila axons have a rest tension of a few nN and respond to mechanical forces in a manner characteristic of viscoelastic solids. In response to fast externally applied stretch they show a linear force-deformation response and when the applied stretch is held constant the force in the axons relaxes to a steady state value over time. More importantly, when the tension in the axons is suddenly reduced by releasing the external force the neurons actively restore the tension, sometimes close to their resting value. Along with the recent findings of Siechen et al (Proc. Natl. Acad. Sci. USA 106, 12611 (2009)) showing a link between mechanical tension and synaptic plasticity, our observation of active tension regulation in neurons suggest an important role for mechanical forces in the functioning of neurons in vivo.