Statecharts and Petri nets are two popular visual formalisms for modelling complex systems that exhibit concurrency. Both formalisms are supported by various design tools. To enable the automated exchange of models between Petri net and statechart tools, we present a structural, polynomial algorithm that translates safe Petri nets into statecharts. The translation algorithm preserves both the structure and the behaviour of the input net. The algorithm can fail, since not every safe net has a statechart translation that preserves both its structure and behaviour. The class of safe nets for which the algorithm succeeds is formally characterised. Some statechart translations are not constructible by the algorithm, but this does not seem to be ...