Except as provided in this section, evidence of a plea of guilty or nolo contendere which was later withdrawn, of an offer to plead guilty or nolo contendere to the crime charged or any other crime, or of statements made in connection with, and relevant to, any of the foregoing pleas or offers, is not admissible in any civil or criminal proceeding against the person who made the plea or offer. However, evidence of a statement made in connection with, and relevant to a plea of guilty or nolo contendere, later withdrawn, or an offer to plead guilty or nolo contendere to the crime charged or any other crime, is admissible in a criminal proceeding for perjury if the statement was made by the defendant under oath, on the record, and in the presence of counsel.
SDCL 23A-7-13