After commencement of a prosecution the prosecutor may, upon reasonable grounds, move the magistrate before whom the prosecution is pending to dismiss the prosecution. If, in the judgment of the magistrate, the prosecution should not continue, he may dismiss the prosecution and enter an order of dismissal stating the reasons for the dismissal in the order.
Utah Code § 77-2-4