diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/inspectdb.py
index 08870af56b..8fab69de59 100644
--- a/django/core/management/commands/inspectdb.py
+++ b/django/core/management/commands/inspectdb.py
@@ -108,9 +108,12 @@ class Command(NoArgsCommand):
                 # Add 'null' and 'blank', if the 'null_ok' flag was present in the
                 # table description.
                 if row[6]: # If it's NULL...
-                    extra_params['blank'] = True
-                    if not field_type in ('TextField(', 'CharField('):
-                        extra_params['null'] = True
+                    if field_type == 'BooleanField(':
+                        field_type = 'NullBooleanField('
+                    else:
+                        extra_params['blank'] = True
+                        if not field_type in ('TextField(', 'CharField('):
+                            extra_params['null'] = True
 
                 field_desc = '%s = models.%s' % (att_name, field_type)
                 if extra_params:
diff --git a/tests/regressiontests/inspectdb/models.py b/tests/regressiontests/inspectdb/models.py
index ae14c78eb7..057ff69efe 100644
--- a/tests/regressiontests/inspectdb/models.py
+++ b/tests/regressiontests/inspectdb/models.py
@@ -34,6 +34,7 @@ class ColumnTypes(models.Model):
     id = models.AutoField(primary_key=True)
     field1 = models.BigIntegerField()
     field2 = models.BooleanField()
+    field2b = models.NullBooleanField()
     field3 = models.CharField(max_length=10)
     field4 = models.CommaSeparatedIntegerField(max_length=99)
     field5 = models.DateField()
@@ -46,7 +47,6 @@ class ColumnTypes(models.Model):
     field12 = models.IntegerField()
     field13 = models.IPAddressField()
     field14 = models.GenericIPAddressField(protocol="ipv4")
-    field15 = models.NullBooleanField()
     field16 = models.PositiveIntegerField()
     field17 = models.PositiveSmallIntegerField()
     field18 = models.SlugField()
diff --git a/tests/regressiontests/inspectdb/tests.py b/tests/regressiontests/inspectdb/tests.py
index faf4f2fb2a..56c7275558 100644
--- a/tests/regressiontests/inspectdb/tests.py
+++ b/tests/regressiontests/inspectdb/tests.py
@@ -39,8 +39,10 @@ class InspectDBTestCase(TestCase):
         if connection.vendor == 'mysql':
             # No native boolean type on MySQL
             assertFieldType('field2', "models.IntegerField()")
+            assertFieldType('field2b', "models.IntegerField(null=True, blank=True)")
         else:
             assertFieldType('field2', "models.BooleanField()")
+            assertFieldType('field2b', "models.NullBooleanField()")
         assertFieldType('field3', "models.CharField(max_length=10)")
         # CommaSeparatedIntegerField
         assertFieldType('field4', "models.CharField(max_length=99)")
@@ -68,8 +70,6 @@ class InspectDBTestCase(TestCase):
         else:
             assertFieldType('field13', "models.CharField(max_length=15)")
             assertFieldType('field14', "models.CharField(max_length=39)")
-        # Ticket #19341
-        #assertFieldType('field15', "models.NullBooleanField()")
         if connection.vendor == 'sqlite':
             assertFieldType('field16', "models.PositiveIntegerField()")
             assertFieldType('field17', "models.PositiveSmallIntegerField()")