Three militants killed in encounter