How long does a granted patent stay valid?

The maximum term of a European patent is 20 years from its filing date. The patent may lapse earlier if the annual renewal fees are not paid or if the patent is revoked by the patentee or after opposition proceedings. In certain cases (medical or plant protection product patents) it is possible to extend the period of protection.