The invention provides an effervescent pharmaceutical composition comprising a biphosphonate compound or its pharmaceutically acceptable salt, a carbonate source, an acid source, a divalent metal salt as humidity moderator and a divalent cation scavenger, wherein the molar ratio of divalent cation scavenger to humidity moderator is at least 0.8/1. This composition makes the production of effervescent formulations comprising biphosphonate compounds easier, since less stringent controls or even no control of environmental humidity conditions have to be carried out during the production of the product. Moreover, the final product is protected against the negative impact of humidity, which may induce disintegration during the shelf-life of the product.