diff --git a/CHANGELOG.md b/CHANGELOG.md
index 11a92d83b16135da0a8104b91bd3160f2d6c2bb3..e7242699415c3bd357003a5e91cd1a70b5d2f02c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,8 +10,7 @@ that users understand how the changes affect the new version.
 
 version 5.0.0-dev
 ---------------------------
-+ Change the way localization of the input bam files and index are handled
-  in the bam2fastx tasks.
++ Samtools: Add mkdir line to `Fastq` task.
 + Add new parameters from CCS version 6.0.0 and add two new outputs:
   `ccs_report.txt` & `zmw_metrics.json.gz`.
 + Change CutAdapt memory to `5G`.
diff --git a/samtools.wdl b/samtools.wdl
index 9042a0dfc42b0d3b8bb158ac9ee2fa902c633849..46d1eb701461ae9f9c3464569380d42c6f74e45f 100644
--- a/samtools.wdl
+++ b/samtools.wdl
@@ -122,6 +122,8 @@ task Fastq {
     }
 
     command {
+        set -e
+        mkdir -p "$(dirname ~{outputRead1})"
         samtools fastq \
         ~{true="-1" false="-s" defined(outputRead2)} ~{outputRead1} \
         ~{"-2 " + outputRead2} \