A search for weakly interacting massive dark-matter particles produced in association with bottom or top quarks is presented. Final states containing third-generation quarks and missing transverse momentum are considered. The analysis uses 36.1fb-1 of proton–proton collision data recorded by the ATLAS experiment at s=13 TeV in 2015 and 2016. No significant excess of events above the estimated backgrounds is observed. The results are interpreted in the framework of simplified models of spin-0 dark-matter mediators. For colour-neutral spin-0 mediators produced in association with top quarks and decaying into a pair of dark-matter particles, mediator masses below 50 GeV are excluded assuming a dark-matter candidate mass of 1 GeV and unitary co...