Military officials say at least three soldiers and 12 militants have been killed in a clash in southwestern Pakistan .