diff --git a/ast_test.go b/ast_test.go
index <HASH>..<HASH> 100644
--- a/ast_test.go
+++ b/ast_test.go
@@ -566,6 +566,18 @@ var astTests = []testCase{
 	},
 	{
 		[]string{
+			"foo <<\\EOF\nbar\nEOF",
+			"foo <<\\EOF\nbar",
+		},
+		Stmt{
+			Node: litCmd("foo"),
+			Redirs: []Redirect{
+				{Op: SHL, Word: litWord("\\EOF\nbar\nEOF")},
+			},
+		},
+	},
+	{
+		[]string{
 			"foo <<-EOF\nbar\nEOF",
 			"foo <<- EOF\nbar\nEOF",
 		},
diff --git a/parse.go b/parse.go
index <HASH>..<HASH> 100644
--- a/parse.go
+++ b/parse.go
@@ -949,6 +949,11 @@ func unquote(w Word) (unq Word) {
 			unq.Parts = append(unq.Parts, Lit{Value: x.Value})
 		case DblQuoted:
 			unq.Parts = append(unq.Parts, x.Parts...)
+		case Lit:
+			if x.Value[0] == '\\' {
+				x.Value = x.Value[1:]
+			}
+			unq.Parts = append(unq.Parts, x)
 		default:
 			unq.Parts = append(unq.Parts, n)
 		}
When unquoting heredoc words, drop leading \

Couldn't find any documentation on this, but both dash and bash seem to
do this.