diff --git a/mollom.module b/mollom.module
index 92a4a64..8ca0d80 100644
--- a/mollom.module
+++ b/mollom.module
@@ -674,7 +674,23 @@ function mollom_form_alter(&$form, &$form_state, $form_id) {
       // Append a submit handler to store Mollom session data. Requires that
       // the primary submit handler has run already, so a potential 'post_id'
       // mapping can be retrieved from $form_state['values'].
-      $form['#submit'][] = 'mollom_form_submit';
+      // @todo Core: node_form_submit() uses a button-level submit handler,
+      //   which invokes form-level submit handlers before the node/entity is
+      //   saved, so $form_state does not contain the new node ID yet. There is
+      //   no #post_submit property or form processing phase, we could rely on.
+      //   Potentially applies to other contrib entities, too.
+      // @see http://drupal.org/node/1150756
+      // In D6, node_form() is probably the only function that sets both
+      // $form['#node'] and $form_state['node']. Compared to that, the
+      // $form['#id'] of 'node-form' is less reliable, since any module can
+      // (rightfully) alter it.
+      if (isset($form['#node']) && isset($form_state['node'])) {
+        $form_submit_key = &$form['buttons']['submit'];
+      }
+      else {
+        $form_submit_key = &$form;
+      }
+      $form_submit_key['#submit'][] = 'mollom_form_submit';
 
       // Add link to privacy policy on forms protected via textual analysis,
       // if enabled.
diff --git a/tests/mollom.test b/tests/mollom.test
index 15fa42e..b307021 100644
--- a/tests/mollom.test
+++ b/tests/mollom.test
@@ -2060,6 +2060,55 @@ class MollomProfileFormsTestCase extends MollomWebTestCase {
   }
 }
 
+/**
+ * Tests Node module integration.
+ */
+class MollomNodeFormTestCase extends MollomWebTestCase {
+  private $node;
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Node integration',
+      'description' => 'Tests node form protection.',
+      'group' => 'Mollom',
+    );
+  }
+
+  function setUp() {
+    parent::setUp();
+
+    $this->web_user = $this->drupalCreateUser(array('create story content'));
+  }
+
+  /**
+   * Tests saving of Mollom data for protected node forms.
+   *
+   * node_form() uses a button-level form submit handler, which invokes
+   * form-level submit handlers before a new node entity has been stored.
+   * Therefore, the submitted form values do not contain a 'nid' yet, so Mollom
+   * session data cannot be stored for the new node.
+   */
+  function testData() {
+    // Enable Mollom CAPTCHA protection for Article nodes.
+    $this->drupalLogin($this->admin_user);
+    $this->setProtection('story_node_form', MOLLOM_MODE_CAPTCHA);
+    $this->drupalLogout();
+
+    // Login and submit a node.
+    $this->drupalLogin($this->web_user);
+    $this->drupalGet('node/add/story');
+    $session_id = $this->assertSessionIDInForm();
+    $edit = array(
+      'title' => 'spam',
+      'mollom[captcha]' => 'correct',
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->node = $this->drupalGetNodeByTitle($edit['title']);
+    $this->assertUrl('node/' . $this->node->nid);
+    $this->assertMollomData('node', $this->node->nid, $session_id);
+  }
+}
+
 class MollomCommentFormTestCase extends MollomWebTestCase {
   private $node;
 
