MINNEAPOLIS (AP) — A Minnesota prosecutor has been ordered to stay away from a 17-year-old girl and her parents after being accused of an improper relationship with the girl.

Cook County Attorney Tim Scannell is the subject of a restraining order. The girl's parents say Scannell was a longtime family friend who told them this summer that he had fallen in love with the teen.

Their petition accuses him of continuing to contact the girl after promising not to.

He became a public figure after he was wounded in a courthouse shooting in December 2011. Scannell went on to testify for a new law allowing prosecutors to carry guns on duty if they have a permit.