We have converted nanoscale mechanical energy into electrical energy by means of piezoelectric zinc oxide nanowire (NW) arrays. The aligned NWs are deflected with a conductive atomic force microscope tip in contact mode. The coupling of piezoelectric and semiconducting properties in zinc oxide creates a strain field and charge separation across the NW as a result of its bending. The rectifying characteristic of the Schottky barrier formed between the metal tip and the NW leads to electrical current generation. The efficiency of the NW-based piezoelectric power generator is estimated to be 17 to 30%. This approach has the potential of converting mechanical, vibrational, and/or hydraulic energy into electricity for powering nanodevices.