
650 So.2d 681 (1995)
Raphael ROSADO, Appellant,
v.
STATE of Florida, Appellee.
No. 93-04171.
District Court of Appeal of Florida, Second District.
February 17, 1995.
*682 James Marion Moorman, Public Defender, Bartow, and Brad Permar, Asst. Public Defender, Clearwater, for appellant.
Robert A. Butterworth, Atty. Gen., Tallahassee, and William I. Munsey, Jr., Asst. Atty. Gen., Tampa, for appellee.
RYDER, Acting Chief Judge.
Raphael Rosado challenges the trial court's refusal to permit him to raise an insanity defense at his trial on charges of battery and aggravated battery on a law enforcement officer. He argues that the court erred in denying his motion for leave to file a belated notice of intent to rely on the defense. We agree with Rosado, reverse and remand for a new trial.
The state originally charged Rosado with these offenses on June 27, 1989. On October 4, 1989, the circuit court entered an order to determine competency, based on the defense's oral motion to determine competency and sanity at the time of the offense. On October 27, 1989, the court ruled that Rosado was incompetent to stand trial and involuntarily committed him. In June and August 1993, the defense again filed motions to determine Rosado's competency. Both of these motions averred that "counsel for the defendant has reason to believe that [Rosado] may have been insane at the time of the offense... ." In response to these motions the lower court entered two orders to determine competency. Each stated it was pursuant to Rosado's motion to determine competency and sanity at the time of the offense. The lower court entered its order finding Rosado competent to stand trial on September 3, 1993.
On September 24, 1993, Rosado served a notice to rely on the insanity defense with a statement of particulars, and a motion for leave to file the notice belatedly. At a hearing on September 27, 1993, defense counsel stated he had learned, on the date he served the notice, that a doctor was willing to testify that Rosado was insane at the time of the crime. The defense had no objection to a continuance if the state needed one. Moreover, the prosecutor stated he could try the case. The trial court denied Rosado's motion to file a belated notice on the grounds that the notice was too late under Florida Rule of Criminal Procedure 3.216.
Under the facts of this case, the trial court's decision was in error. As in Morgan v. State, 453 So.2d 394 (Fla. 1984), we can find nothing in this record to justify the trial court's refusal to permit Rosado to raise the insanity defense, his only defense to the charges. The state had been on notice of a potential insanity defense since October 1989 when Rosado first asked the court to determine his competency to stand trial and sanity at the time of the offense. The prosecution's objection to the notice was based on the technical grounds that it was belatedly filed. The state never contended it was prejudiced by the late filing; in fact, the prosecutor stated he could proceed to trial. Defense counsel explained that he had filed the notice as soon as he discovered that a doctor was willing to testify in support of the defense. Even after the lower court denied the motion to file a late notice, counsel continued to urge the court to allow Rosado to raise the defense. He filed a motion for reconsideration of the trial court's order on October 5, 1993, the day of trial, and a written proffer of what the doctor's testimony was expected to be. He renewed the motion at the conclusion of the trial.
Where there is no prejudice to the state and the defendant's failure to comply with the rules of procedure is merely a technical failure, exclusion of his only viable defense is too harsh a sanction. Shepherd v. State, 453 So.2d 215, 217 (Fla. 5th DCA 1984). This is particularly true when the state was aware of *683 the potential defense before the notice was filed. See Morgan. We reverse the judgment against Rosado and remand for a new trial where he shall be permitted to raise the defense of insanity.
Reversed and remanded for a new trial.
THREADGILL and ALTENBERND, JJ., concur.
