diff --git a/ginger.cabal b/ginger.cabal
--- a/ginger.cabal
+++ b/ginger.cabal
@@ -2,7 +2,7 @@
 -- documentation, see http://haskell.org/cabal/users-guide/
 
 name:                ginger
-version:             0.3.5.0
+version:             0.3.5.1
 synopsis:            An implementation of the Jinja2 template language in Haskell
 description:         Ginger is Jinja, minus the most blatant pythonisms. Wants
                      to be feature complete, but isn't quite there yet.
diff --git a/src/Text/Ginger/Parse.hs b/src/Text/Ginger/Parse.hs
--- a/src/Text/Ginger/Parse.hs
+++ b/src/Text/Ginger/Parse.hs
@@ -52,6 +52,7 @@
 import Data.HashMap.Strict (HashMap)
 import qualified Data.HashMap.Strict as HashMap
 import Data.Default ( Default (..) )
+import Data.Monoid ( (<>) )
 
 import System.FilePath ( takeDirectory, (</>) )
 
@@ -174,7 +175,9 @@
 derivedTemplateP = do
     parentName <- try (spaces >> fancyTagP "extends" stringLiteralP)
     parentTemplate <- includeTemplate parentName
-    blocks <- HashMap.fromList <$> many blockP
+    topLevelBlocks <- HashMap.fromList <$> many blockP
+    nestedBlocks <- psBlocks <$> getState
+    let blocks = topLevelBlocks <> nestedBlocks
     return Template { templateBody = NullS, templateParent = Just parentTemplate, templateBlocks = blocks }
 
 baseTemplateP :: Monad m => Parser m Template
