Any aggrieved person may move to suppress the contents of any intercepted wire, oral, or electronic communication, or evidence derived therefrom on the grounds that:
(1) the wire, oral, or electronic communication was unlawfully intercepted;
(2) the order of authorization or approval under which it was intercepted is insufficient on its face;
(3) the interception was not made in conformity with the order of authorization or approval;
(4) there was not probable cause for believing the existence of the grounds on which the warrant was issued; or
(5) the evidence was otherwise illegally obtained.
The court shall hear evidence upon any issue of fact necessary to a determination of the motion.
If the motion is granted, the contents of the intercepted wire, oral, or electronic communication, or evidence derived therefrom, shall be treated as having been obtained in violation of this chapter.
If the motion is denied, the order denying such may be reviewed on appeal from a judgment of conviction notwithstanding the fact that such judgment of conviction is predicated upon a plea of guilty.
Upon receiving the notice required to be given by section 626A.10, subdivision 2, a defendant shall make a motion to suppress prior to the commencement of any trial or hearing in which the communications or conversations claimed to have been unlawfully obtained are proposed to be offered as evidence, except that the court shall entertain a motion made for the first time during trial upon a showing that (a) the defendant was unaware of the interception of communications until after the commencement of the trial, or (b) the defendant obtained material evidence previously unavailable to the defendant indicating it was unlawfully obtained, or (c) the defendant has not had adequate time or opportunity to make the motion before trial.
If a motion has been made and denied before trial, the determination shall be binding upon the trial court, except that, if it is established that, after the making of such motion, the defendant obtained additional material evidence of unlawfulness which could not have been obtained with reasonable diligence before the making of the motion, the court shall entertain another motion, or a renewal of a motion, during the trial.
When the motion is made before trial, the trial shall not be commenced until the motion has been determined.
When the motion is made during trial, the court shall, in the absence of the jury, if there be one, hear evidence in the same manner as if the motion had been made prior to trial, and shall decide all issues of fact and law.
If no motion is made in accordance with the provisions of this section, the defendant shall be deemed to have waived any objection during trial to the admission of evidence based on the ground that such evidence was unlawfully obtained.
The motion shall be made in the court having jurisdiction of the trial, hearing, or proceeding in which the evidence is being sought to be used.
In any motion made under this section, if the court finds necessary to the determination of such motion to consider the contents of the intercepted communications in question, and the state does not consent to the examination thereof by the moving party, the court may order the state to deliver such recordings and any transcripts of the same for the inspection of the court in camera. Upon such delivery the court shall rule on the motion, and if the moving party objects to such ruling, and the trial is continued to an adjudication of the guilt of the moving party, the entire recordings shall be preserved by the state, and, in the event the defendant appeals, shall be made available to the appellate court for the purpose of determining the correctness of the ruling of the trial judge.
The state shall be allowed to appeal from an order granting a motion to suppress evidence obtained through intercepted communications, if the prosecuting attorney shall certify to the judge or other official granting such motion that the appeal is not taken for purposes of delay. Such appeal shall be taken within 30 days after the date the order was entered and shall be diligently prosecuted. The appeal shall be made pursuant to rule 29.03 of the Rules of Criminal Procedure.