Neural prostheses can restore meaningful function to paralysed muscles by electrically stimulating innervating motor axons, but fail when muscles are completely denervated, as seen in amyotrophic lateral sclerosis, or after a peripheral nerve or spinal cord injury. Here we show that channelrhodopsin-2 is expressed within the sarcolemma and T-tubules of skeletal muscle fibres in transgenic mice. This expression pattern allows for optical control of muscle contraction with comparable forces to nerve stimulation. Force can be controlled by varying light pulse intensity, duration or frequency. Light-stimulated muscle fibres depolarize proportionally to light intensity and duration. Denervated triceps surae muscles transcutaneously stimulated optically on a daily basis for 10 days show a significant attenuation in atrophy resulting in significantly greater contractile forces compared with chronically denervated muscles. Together, this study shows that channelrhodopsin-2/H134R can be used to restore function to permanently denervated muscles and reduce pathophysiological changes associated with denervation pathologies.