diff --git a/src/Plugin/ImporterBase.php b/src/Plugin/ImporterBase.php
index f416d7f..1879835 100644
--- a/src/Plugin/ImporterBase.php
+++ b/src/Plugin/ImporterBase.php
@@ -248,6 +248,18 @@ abstract class ImporterBase extends PluginBase implements ImporterInterface {
       $content[$key] = $this->attach($item);
     }
 
+    // Remove empty entity reference fields to prevent SQL errors.
+    // When CSV cells are empty, they become empty strings which cause
+    // "Incorrect integer value" SQL errors when trying to save entity references.
+    $field_definitions = $this->entityFieldManager->getFieldDefinitions($entity_type, $entity_type_bundle);
+    foreach ($content as $key => $value) {
+      if (isset($field_definitions[$key]) &&
+          $field_definitions[$key]->getType() === 'entity_reference' &&
+          empty($value)) {
+        unset($content[$key]);
+      }
+    }
+
     /** @var \Drupal\Core\Entity\Sql\SqlContentEntityStorage $entity_storage  */
     $entity_storage = $this->entityTypeManager->getStorage($this->configuration['entity_type']);
 
diff --git a/tests/files/sample_empty_entity_reference.csv b/tests/files/sample_empty_entity_reference.csv
new file mode 100644
index 0000000..cd05aaa
--- /dev/null
+++ b/tests/files/sample_empty_entity_reference.csv
@@ -0,0 +1,4 @@
+nid,title,field_category
+2000,Article with category,1
+2001,Article without category,
+2002,Another article with empty category,
diff --git a/tests/src/Kernel/EmptyEntityReferenceTest.php b/tests/src/Kernel/EmptyEntityReferenceTest.php
new file mode 100644
index 0000000..3138a7b
--- /dev/null
+++ b/tests/src/Kernel/EmptyEntityReferenceTest.php
@@ -0,0 +1,168 @@
+<?php
+
+namespace Drupal\Tests\csv_importer\Kernel;
+
+use Drupal\field\Entity\FieldConfig;
+use Drupal\field\Entity\FieldStorageConfig;
+use Drupal\KernelTests\KernelTestBase;
+use Drupal\node\Entity\Node;
+use Drupal\node\Entity\NodeType;
+use Drupal\taxonomy\Entity\Term;
+use Drupal\taxonomy\Entity\Vocabulary;
+
+/**
+ * Tests CSV import with empty entity reference fields.
+ *
+ * This test validates that the patch for handling empty entity reference
+ * fields prevents SQL errors when importing CSV files with empty cells.
+ *
+ * @group csv_importer
+ */
+class EmptyEntityReferenceTest extends KernelTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected static $modules = [
+    'system',
+    'user',
+    'node',
+    'field',
+    'text',
+    'taxonomy',
+    'csv_importer',
+  ];
+
+  /**
+   * The CSV importer plugin manager.
+   *
+   * @var \Drupal\csv_importer\Plugin\ImporterManager
+   */
+  protected $importerManager;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp(): void {
+    parent::setUp();
+
+    $this->installEntitySchema('user');
+    $this->installEntitySchema('node');
+    $this->installEntitySchema('taxonomy_term');
+    $this->installSchema('node', ['node_access']);
+    $this->installSchema('system', ['sequences']);
+    $this->installConfig(['node', 'field', 'taxonomy']);
+
+    // Create article content type.
+    $node_type = NodeType::create([
+      'type' => 'article',
+      'name' => 'Article',
+    ]);
+    $node_type->save();
+
+    // Create a taxonomy vocabulary.
+    $vocabulary = Vocabulary::create([
+      'vid' => 'tags',
+      'name' => 'Tags',
+    ]);
+    $vocabulary->save();
+
+    // Create a term for testing.
+    $term = Term::create([
+      'vid' => 'tags',
+      'tid' => 1,
+      'name' => 'Test Tag',
+    ]);
+    $term->save();
+
+    // Create entity reference field.
+    FieldStorageConfig::create([
+      'field_name' => 'field_tags',
+      'entity_type' => 'node',
+      'type' => 'entity_reference',
+      'settings' => [
+        'target_type' => 'taxonomy_term',
+      ],
+    ])->save();
+
+    FieldConfig::create([
+      'field_name' => 'field_tags',
+      'entity_type' => 'node',
+      'bundle' => 'article',
+      'label' => 'Tags',
+      'settings' => [
+        'handler' => 'default:taxonomy_term',
+        'handler_settings' => [
+          'target_bundles' => ['tags' => 'tags'],
+        ],
+      ],
+    ])->save();
+
+    $this->importerManager = $this->container->get('plugin.manager.importer');
+  }
+
+  /**
+   * Test importing CSV with empty entity reference fields.
+   *
+   * This test verifies that empty entity reference values in CSV files
+   * do not cause SQL errors. Without the patch, this would fail with:
+   * "Incorrect integer value: '' for column 'tid'"
+   */
+  public function testEmptyEntityReference() {
+    $configuration = [
+      'entity_type' => 'node',
+      'entity_type_bundle' => 'article',
+      'fields' => ['title', 'field_tags'],
+    ];
+
+    $importer = $this->importerManager->createInstance('importer:node', $configuration);
+
+    // Test data with empty entity reference.
+    $contents = [
+      // Row with valid entity reference.
+      [
+        'title' => 'Article with tag',
+        'field_tags' => '1',
+      ],
+      // Row with empty entity reference - this is what the patch fixes.
+      [
+        'title' => 'Article without tag',
+        'field_tags' => '',
+      ],
+      // Another row with empty reference.
+      [
+        'title' => 'Another article',
+        'field_tags' => '',
+      ],
+    ];
+
+    $context = [];
+
+    // Import all rows.
+    foreach ($contents as $index => $row) {
+      $context['sandbox']['progress'] = $index;
+      $importer->add([$row], $context);
+    }
+
+    // Verify all nodes were created.
+    $this->assertCount(3, $context['results']['added'], 'All three nodes should be created without SQL errors.');
+
+    // Verify the first node has the tag.
+    $node1 = Node::load($context['results']['added'][0]);
+    $this->assertFalse($node1->get('field_tags')->isEmpty(), 'First node should have a tag.');
+    $this->assertEquals(1, $node1->get('field_tags')->target_id, 'First node should reference term ID 1.');
+
+    // Verify the second and third nodes have no tags (not empty strings).
+    $node2 = Node::load($context['results']['added'][1]);
+    $this->assertTrue($node2->get('field_tags')->isEmpty(), 'Second node should have an empty tag field (not empty string).');
+
+    $node3 = Node::load($context['results']['added'][2]);
+    $this->assertTrue($node3->get('field_tags')->isEmpty(), 'Third node should have an empty tag field (not empty string).');
+
+    // Clean up.
+    foreach ($context['results']['added'] as $nid) {
+      Node::load($nid)->delete();
+    }
+  }
+
+}
