Godleman and Slater begin massive Derbyshire chase
The Sri Lankan finished with 6 for 204 from 52.3 overs as the visitors lost their last six wickets for 38 but his analysis was the most expensive by a Derbyshire bowler since 1904.
Ned Eckersley made a career best 158 but his departure to a good diving catch at deep midwicket sparked a late collapse in which Mendis took four wickets.
Derbyshire went in needing 470 just to avoid the follow on but skipper Billy Godleman and Ben Slater scored 38 from 13 overs before tea.