  A search for an invisibly decaying Higgs boson or dark matter candidates
produced in association with a leptonically decaying $Z$ boson in
proton--proton collisions at $\sqrt{s} =$ 13 TeV is presented. This search uses
36.1 fb$^{-1}$ of data collected by the ATLAS experiment at the Large Hadron
Collider. No significant deviation from the expectation of the Standard Model
backgrounds is observed. Assuming the Standard Model $ZH$ production
cross-section, an observed (expected) upper limit of 67% (39%) at the 95%
confidence level is set on the branching ratio of invisible decays of the Higgs
boson with mass $m_H = $ 125 GeV. The corresponding limits on the production
cross-section of the $ZH$ process with the invisible Higgs boson decays are
also presented. Furthermore, exclusion limits on the dark matter candidate and
mediator masses are reported in the framework of simplified dark matter models.
