With the surge of interest in miniaturized implanted medical devices (IMDs), implantable power sources with small dimensions and biocompatibility are in high demand. Implanted battery/supercapacitor devices are commonly packaged within a case that occupies a large volume, making miniaturization difficult. In this study, we demonstrate a polymer electrolyte-enabled biocompatible magnesium-air battery device with a total thickness of approximately 300 μm. It consists of a biocompatible polypyrrole-para(toluene sulfonic acid) cathode and a bioresorbable magnesium alloy anode. The biocompatible electrolyte used is made of choline nitrate (ionic liquid) embedded in a biopolymer, chitosan. This polymer electrolyte is mechanically robust and offers a high ionic conductivity of 8.9 x 10-3 S cm-1. The assembled battery delivers a maximum volumetric power density of 3.9 W L-1, which is sufficient to drive some types of IMDs, such as cardiac pacemakers or biomonitoring systems. This miniaturized, biocompatible magnesium-air battery may pave the way to a future generation of implantable power sources.