diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityComment.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityComment.php
index 451f2d5..0dac82c 100644
--- a/core/modules/migrate/src/Plugin/migrate/destination/EntityComment.php
+++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityComment.php
@@ -11,7 +11,8 @@
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\State\StateInterface;
 use Drupal\migrate\Entity\MigrationInterface;
-use Drupal\migrate\Plugin\MigratePluginManager;
+use Drupal\Core\Entity\Query\QueryFactory;
+use Drupal\migrate\MigrateSkipRowException;
 use Drupal\migrate\Row;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -30,6 +31,20 @@ class EntityComment extends EntityContentBase {
   protected $state;
 
   /**
+   * The entity query object.
+   *
+   * @var \Drupal\Core\Entity\Query\QueryInterface
+   */
+  protected $entityQuery;
+
+  /**
+   * The entity ID used for 'commented entity' objects in stub rows.
+   *
+   * @var string
+   */
+  protected $stubCommentedEntityId;
+
+  /**
    * Builds an comment entity destination.
    *
    * @param array $configuration
@@ -44,16 +59,17 @@ class EntityComment extends EntityContentBase {
    *   The storage for this entity type.
    * @param array $bundles
    *   The list of bundles this entity type has.
-   * @param \Drupal\migrate\Plugin\MigratePluginManager $plugin_manager
-   *   The migrate plugin manager.
    * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
    *   The entity manager service.
    * @param \Drupal\Core\State\StateInterface $state
    *   The state storage object.
+   * @param \Drupal\Core\Entity\Query\QueryFactory $entity_query
+   *   The query object that can query the given entity type.
    */
-  public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, array $bundles, EntityManagerInterface $entity_manager, StateInterface $state) {
+  public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, array $bundles, EntityManagerInterface $entity_manager, StateInterface $state, QueryFactory $entity_query) {
     parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $storage, $bundles, $entity_manager);
     $this->state = $state;
+    $this->entityQuery = $entity_query;
   }
 
   /**
@@ -69,7 +85,8 @@ public static function create(ContainerInterface $container, array $configuratio
       $container->get('entity.manager')->getStorage($entity_type),
       array_keys($container->get('entity.manager')->getBundleInfo($entity_type)),
       $container->get('entity.manager'),
-      $container->get('state')
+      $container->get('state'),
+      $container->get('entity.query')
     );
   }
 
@@ -87,4 +104,42 @@ public function import(Row $row, array $old_destination_id_values = array()) {
     return $return;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  protected function getEntity(Row $row, array $old_destination_id_values) {
+    if ($row->stub()) {
+      // Try to find the entity_type in 'constants/entity_type' otherwise
+      // fallback to 'node'.
+      $stub_commented_entity_type = isset($this->migration->source['constants']['entity_type']) ? $this->migration->source['constants']['entity_type'] : 'node';
+
+      // While parent::getEntity() fills the bundle property for stub entities
+      // if it's still empty, here we must also make sure entity_id/entity_type
+      // are filled (so $comment->getCommentedEntity() always returns a value).
+      if (empty($this->stubCommentedEntityId)) {
+
+        // Fill stub entity id. Any id will do, as long as it exists.
+        $entity_type = $this->entityManager->getDefinition($stub_commented_entity_type);
+        if ($id_key = $entity_type->getKey('id')) {
+
+          $result = $this->entityQuery
+            ->getAggregate($stub_commented_entity_type)
+            ->aggregate($id_key, 'MIN')
+            ->execute();
+          if ($result) {
+            $this->stubCommentedEntityId = $result[0][$id_key . '_min'];
+          }
+        }
+      }
+      if (empty($this->stubCommentedEntityId)) {
+        throw new MigrateSkipRowException(t('Could not derive commented entity for comment %id', array('%id' => implode(':', $row->getSourceIdValues()))));
+      }
+
+      $row->setDestinationProperty('entity_id', $this->stubCommentedEntityId);
+      $row->setDestinationProperty('entity_type', $stub_commented_entity_type);
+    }
+
+    return parent::getEntity($row, $old_destination_id_values);
+  }
+
 }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php
index c1e9273..10c2fc3 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php
@@ -19,7 +19,10 @@
  */
 class MigrateCommentTest extends MigrateDrupalTestBase {
 
-  static $modules = array('node', 'comment');
+  // Directly testing that comments' entity_id is populated upon importing is
+  // not straightforward, but RDF module serves as an implicit test;
+  // its hook_comment_storage_load() references $comment->getCommentedEntity().
+  static $modules = array('node', 'comment', 'rdf');
 
   /**
    * {@inheritdoc}
