diff --git a/lib/structure_element.js b/lib/structure_element.js
index <HASH>..<HASH> 100644
--- a/lib/structure_element.js
+++ b/lib/structure_element.js
@@ -10,7 +10,6 @@ class PDFStructureElement {
     this.document = document;
 
     this._ended = false;
-    this._flushed = false;
     this.dictionary = document.ref({
       // Type: "StructElem",
       S: type
@@ -92,6 +91,10 @@ class PDFStructureElement {
   }
 
   setParent(parentRef) {
+    if (this.dictionary.data.P) {
+      throw new Error(`Structure element added to more than one parent`);
+    }
+
     this.dictionary.data.P = parentRef;
 
     if (this._ended) {
diff --git a/tests/unit/markings.spec.js b/tests/unit/markings.spec.js
index <HASH>..<HASH> 100644
--- a/tests/unit/markings.spec.js
+++ b/tests/unit/markings.spec.js
@@ -426,6 +426,12 @@ EMC
         struct.add(document.struct('Bar'));
       }).toThrow();
 
+      struct = document.struct('Foo');
+      let parent = document.struct('Bar').add(struct);
+      expect(() => {
+        parent.add(struct);
+      }).toThrow();
+
       expect(() => {
         document.struct('Foo', [1]);
       }).toThrow();
Guard against adding a structure element to more than one parent.