diff --git a/core/modules/migrate/src/Plugin/migrate/process/MigrationLookup.php b/core/modules/migrate/src/Plugin/migrate/process/MigrationLookup.php
index 862f114a5d..370f434bc0 100644
--- a/core/modules/migrate/src/Plugin/migrate/process/MigrationLookup.php
+++ b/core/modules/migrate/src/Plugin/migrate/process/MigrationLookup.php
@@ -31,6 +31,8 @@
  *   any stub entities.
  * - no_stub: (optional) Prevents the creation of a stub entity when no
  *   relationship is found in the migration map.
+ * - return_associative: Returns multivalue keys in an associative array if true
+ *   and in an indexed array if false.
  *
  * Examples:
  *
@@ -150,6 +152,8 @@ public static function create(ContainerInterface $container, array $configuratio
    * {@inheritdoc}
    */
   public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
+    $force_assoc = isset($this->configuration['return_associative']) && $this->configuration['return_associative'] == TRUE;
+    $force_indexed = isset($this->configuration['return_associative']) && $this->configuration['return_associative'] === FALSE;
     $lookup_migrations_ids = $this->configuration['migration'];
     if (!is_array($lookup_migrations_ids)) {
       $lookup_migrations_ids = [$lookup_migrations_ids];
@@ -178,6 +182,10 @@ public function transform($value, MigrateExecutableInterface $migrate_executable
       $source_id_values[$lookup_migration_id] = $value;
       // Break out of the loop as soon as a destination ID is found.
       if ($destination_ids = $lookup_migration->getIdMap()->lookupDestinationId($source_id_values[$lookup_migration_id])) {
+        if ($force_assoc) {
+          $destination_keys = array_keys($lookup_migration->getDestinationPlugin()->getIds());
+          $destination_ids = array_combine($destination_keys, $destination_ids);
+        }
         break;
       }
     }
@@ -225,6 +233,9 @@ public function transform($value, MigrateExecutableInterface $migrate_executable
 
       if ($destination_ids) {
         $id_map->saveIdMapping($stub_row, $destination_ids, MigrateIdMapInterface::STATUS_NEEDS_UPDATE);
+        if ($force_indexed) {
+          $destination_ids = array_values($destination_ids);
+        }
       }
     }
     if ($destination_ids) {
diff --git a/core/modules/migrate/tests/src/Unit/process/MigrationLookupTest.php b/core/modules/migrate/tests/src/Unit/process/MigrationLookupTest.php
index 9158cdbdbd..8e3ffaf4f1 100644
--- a/core/modules/migrate/tests/src/Unit/process/MigrationLookupTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/MigrationLookupTest.php
@@ -203,6 +203,110 @@ public function successfulLookupDataProvider() {
     ];
   }
 
+
+  /**
+   * Test lookup return as associative array
+   */
+  /**
+   * Tests a successful lookup.
+   *
+   * @dataProvider successfulLookupAssocDataProvider
+   *
+   * @param array $source_id_values
+   *   The source id(s) of the migration map.
+   * @param array $destination_id_values
+   *   The destination id(s) of the migration map.
+   * @param string|array $source_value
+   *   The source value(s) for the migration process plugin.
+   * @param string|array $expected_value
+   *   The expected value(s) of the migration process plugin.
+   */
+  public function testSuccessfulLookupAssoc($source_id_values, $destination_id_values, $source_value, $expected_value) {
+    $migration_plugin = $this->prophesize(MigrationInterface::class);
+    $migration_plugin_manager = $this->prophesize(MigrationPluginManagerInterface::class);
+    $process_plugin_manager = $this->prophesize(MigratePluginManager::class);
+    $destination_plugin = $this->prophesize(MigrateDestinationInterface::class);
+    $destination_keys = ['id1' => [], 'id2' => []];
+
+    $destination_plugin->getIds()->willReturn(array_slice($destination_keys,0, count($destination_id_values)));
+
+    $configuration = [
+      'migration' => 'foobaz',
+      'return_associative' => TRUE,
+    ];
+    $migration_plugin->id()->willReturn(uniqid());
+
+    $id_map = $this->prophesize(MigrateIdMapInterface::class);
+    $id_map->lookupDestinationId($source_id_values)->willReturn($destination_id_values);
+    $migration_plugin->getIdMap()->willReturn($id_map->reveal());
+    $migration_plugin->getDestinationPlugin()->willReturn($destination_plugin->reveal());
+
+    $migration_plugin_manager->createInstances(['foobaz'])
+      ->willReturn(['foobaz' => $migration_plugin->reveal()]);
+
+    $migrationStorage = $this->prophesize(EntityStorageInterface::class);
+    $migrationStorage
+      ->loadMultiple(['foobaz'])
+      ->willReturn([$migration_plugin->reveal()]);
+
+    $migration = new MigrationLookup($configuration, 'migration_lookup', [], $migration_plugin->reveal(), $migration_plugin_manager->reveal(), $process_plugin_manager->reveal());
+    $this->assertSame($expected_value, $migration->transform($source_value, $this->migrateExecutable, $this->row, 'foo'));
+  }
+
+  /**
+   * Provides data for the successful lookup test.
+   *
+   * @return array
+   */
+  public function successfulLookupAssocDataProvider() {
+    return [
+      // Test data for scalar to scalar.
+      [
+        // Source ID of the migration map.
+        [1],
+        // Destination ID of the migration map.
+        [3],
+        // Input value for the migration plugin.
+        1,
+        // Expected output value of the migration plugin.
+        3,
+      ],
+      // Test data for scalar to array.
+      [
+        // Source ID of the migration map.
+        [1],
+        // Destination IDs of the migration map.
+        [3, 'foo'],
+        // Input value for the migration plugin.
+        1,
+        // Expected output values of the migration plugin.
+        ['id1' => 3, 'id2' => 'foo'],
+      ],
+      // Test data for array to scalar.
+      [
+        // Source IDs of the migration map.
+        [1, 3],
+        // Destination ID of the migration map.
+        ['foo'],
+        // Input values for the migration plugin.
+        [1, 3],
+        // Expected output value of the migration plugin.
+        'foo',
+      ],
+      // Test data for array to array.
+      [
+        // Source IDs of the migration map.
+        [1, 3],
+        // Destination IDs of the migration map.
+        [3, 'foo'],
+        // Input values for the migration plugin.
+        [1, 3],
+        // Expected output values of the migration plugin.
+        ['id1' => 3, 'id2' => 'foo'],
+      ],
+    ];
+  }
+
   /**
    * Tests that a message is successfully created if import fails.
    */
