Precise spike timing through the coordination and synchronization of neuronal assemblies is an efficient and flexible coding mechanism for sensory and cognitive processing. In cortical and subcortical areas, the formation of cell assemblies critically depends on neuronal oscillations, which can precisely control the timing of spiking activity. Whereas this form of coding has been described for sensory processing and spatial learning, its role in encoding emotional behaviour remains unknown. Fear behaviour relies on the activation of distributed structures, among which the dorsal medial prefrontal cortex (dmPFC) is known to be critical for fear memory expression. In the dmPFC, the phasic activation of neurons to threat-predicting cues, a spike-rate coding mechanism, correlates with conditioned fear responses and supports the discrimination between aversive and neutral stimuli. However, this mechanism does not account for freezing observed outside stimuli presentations, and the contribution of a general spike-time coding mechanism for freezing in the dmPFC remains to be established. Here we use a combination of single-unit and local field potential recordings along with optogenetic manipulations to show that, in the dmPFC, expression of conditioned fear is causally related to the organization of neurons into functional assemblies. During fear behaviour, the development of 4 Hz oscillations coincides with the activation of assemblies nested in the ascending phase of the oscillation. The selective optogenetic inhibition of dmPFC neurons during the ascending or descending phases of this oscillation blocks and promotes conditioned fear responses, respectively. These results identify a novel phase-specific coding mechanism, which dynamically regulates the development of dmPFC assemblies to control the precise timing of fear responses.