A major challenge for implantable medical systems is the inclusion or reliable delivery of electrical power. We use ultrasound to deliver mechanical energy through skin and liquids and demonstrate a thin implantable vibrating triboelectric generator able to effectively harvest it. The ultrasound can induce micrometer-scale displacement of a polymer thin membrane to generate electrical energy through contact electrification. We recharge a lithium-ion battery at a rate of 166 microcoulombs per second in water. The voltage and current generated ex vivo by ultrasound energy transfer reached 2.4 volts and 156 microamps under porcine tissue. These findings show that a capacitive triboelectric electret is the first technology able to compete with piezoelectricity to harvest ultrasound in vivo and to power medical implants.