Afghan police say up to 60 militants and 19 civilians have been killed in bloody clashes between rival militant groups in the north of the country.