The growing energy demands have led to an increased attention towards the development of efficient energy storage devices. In this direction, aqueous rechargeable batteries have attracted considerable attention due to their affordability, environmental friendliness and quite importantly, safety. In the present studies, a two-dimensional copolymer of benzoquinone and pyrrole that is insoluble in aqueous solutions is explored as an electrode for aqueous, rechargeable divalent ion storage. The polymer exhibits high capacity, long cycle life and lends itself amenable for high rates of discharge/charge. It reveals a stable capacity of 125 mAh/g at a high current density of 1 A/g in the case of zinc ion batteries while a stable capacity of 75 mAh/g at 1 A/g is observed in the case of aqueous magnesium ion battery. Electrochemical studies reveal contributions due to capacitive storage of the 2-dimensional polymer. The charge storage mechanism due to the involvement of carbonyl groups is deciphered using spectroscopic techniques.