diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
index 649f807..3802b1c 100644
--- a/django/db/backends/__init__.py
+++ b/django/db/backends/__init__.py
@@ -889,8 +889,8 @@ class BaseDatabaseOperations(object):
             return value
         elif internal_type == 'FloatField':
             return float(value)
-        elif (internal_type and (internal_type.endswith('IntegerField')
-                                 or internal_type == 'AutoField')):
+        elif (internal_type and internal_type.endswith('IntegerField')
+                or internal_type.endswith('AutoField')):
             return int(value)
         elif internal_type in ('DateField', 'DateTimeField', 'TimeField'):
             return value
diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py
index cec3b04..fe2ebab 100644
--- a/django/db/backends/mysql/base.py
+++ b/django/db/backends/mysql/base.py
@@ -64,7 +64,7 @@ def adapt_datetime_with_timezone_support(value, conv):
     # Equivalent to DateTimeField.get_db_prep_value. Used only by raw SQL.
     if settings.USE_TZ:
         if timezone.is_naive(value):
-            warnings.warn("SQLite received a naive datetime (%s)"
+            warnings.warn("MySQL received a naive datetime (%s)"
                           " while time zone support is active." % value,
                           RuntimeWarning)
             default_timezone = timezone.get_default_timezone()
diff --git a/django/db/backends/mysql/creation.py b/django/db/backends/mysql/creation.py
index 53bd57e..9876278 100644
--- a/django/db/backends/mysql/creation.py
+++ b/django/db/backends/mysql/creation.py
@@ -6,6 +6,7 @@ class DatabaseCreation(BaseDatabaseCreation):
     # be interpolated against the values of Field.__dict__ before being output.
     # If a column type is set to None, it won't be included in the output.
     data_types = {
+        'BigAutoField':      'bigint AUTO_INCREMENT',
         'AutoField':         'integer AUTO_INCREMENT',
         'BooleanField':      'bool',
         'CharField':         'varchar(%(max_length)s)',
diff --git a/django/db/backends/oracle/creation.py b/django/db/backends/oracle/creation.py
index d9bf3df..0059644 100644
--- a/django/db/backends/oracle/creation.py
+++ b/django/db/backends/oracle/creation.py
@@ -16,6 +16,7 @@ class DatabaseCreation(BaseDatabaseCreation):
     # output (the "qn_" prefix is stripped before the lookup is performed.
 
     data_types = {
+        'BigAutoField':                 'NUMBER(19)',
         'AutoField':                    'NUMBER(11)',
         'BooleanField':                 'NUMBER(1) CHECK (%(qn_column)s IN (0,1))',
         'CharField':                    'NVARCHAR2(%(max_length)s)',
diff --git a/django/db/backends/postgresql_psycopg2/creation.py b/django/db/backends/postgresql_psycopg2/creation.py
index ca389b9..64223b1 100644
--- a/django/db/backends/postgresql_psycopg2/creation.py
+++ b/django/db/backends/postgresql_psycopg2/creation.py
@@ -10,6 +10,7 @@ class DatabaseCreation(BaseDatabaseCreation):
     # be interpolated against the values of Field.__dict__ before being output.
     # If a column type is set to None, it won't be included in the output.
     data_types = {
+        'BigAutoField':      'bigserial',
         'AutoField':         'serial',
         'BooleanField':      'boolean',
         'CharField':         'varchar(%(max_length)s)',
diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py
index 31a16b6..83aedbe 100644
--- a/django/db/backends/sqlite3/base.py
+++ b/django/db/backends/sqlite3/base.py
@@ -210,7 +210,8 @@ class DatabaseOperations(BaseDatabaseOperations):
         internal_type = field.get_internal_type()
         if internal_type == 'DecimalField':
             return util.typecast_decimal(field.format_number(value))
-        elif internal_type and internal_type.endswith('IntegerField') or internal_type == 'AutoField':
+        elif (internal_type and internal_type.endswith('IntegerField')
+                or internal_type.endswith('AutoField')):
             return int(value)
         elif internal_type == 'DateField':
             return parse_date(value)
diff --git a/django/db/backends/sqlite3/creation.py b/django/db/backends/sqlite3/creation.py
index c022b56..8a9952c 100644
--- a/django/db/backends/sqlite3/creation.py
+++ b/django/db/backends/sqlite3/creation.py
@@ -8,6 +8,7 @@ class DatabaseCreation(BaseDatabaseCreation):
     # thing" given more verbose field definitions, so leave them as is so that
     # schema inspection is more useful.
     data_types = {
+        'BigAutoField':                 'integer',
         'AutoField':                    'integer',
         'BooleanField':                 'bool',
         'CharField':                    'varchar(%(max_length)s)',
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
index d07851b..2ce0f3c 100644
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -212,6 +212,13 @@ class Field(object):
         self.run_validators(value)
         return value
 
+    def _internal_to_db_type(self, internal_type, connection):
+        data = DictWrapper(self.__dict__, connection.ops.quote_name, "qn_")
+        try:
+            return connection.creation.data_types[internal_type] % data
+        except KeyError:
+            return None
+
     def db_type(self, connection):
         """
         Returns the database column data type for this field, for the provided
@@ -232,12 +239,14 @@ class Field(object):
         # mapped to one of the built-in Django field types. In this case, you
         # can implement db_type() instead of get_internal_type() to specify
         # exactly which wacky database column type you want to use.
-        data = DictWrapper(self.__dict__, connection.ops.quote_name, "qn_")
-        try:
-            return (connection.creation.data_types[self.get_internal_type()]
-                    % data)
-        except KeyError:
-            return None
+        return self._internal_to_db_type(self.get_internal_type(), connection)
+
+    def rel_db_type(self, connection):
+        """
+        Returns the database column data type for related field referencing
+        to this.
+        """
+        return self.db_type(connection)
 
     @property
     def unique(self):
@@ -521,14 +530,19 @@ class AutoField(Field):
         'invalid': _("'%s' value must be an integer."),
     }
 
-    def __init__(self, *args, **kwargs):
+    def __init__(self, verbose_name=None, name=None, big=False, **kwargs):
         assert kwargs.get('primary_key', False) is True, \
                "%ss must have primary_key=True." % self.__class__.__name__
         kwargs['blank'] = True
-        Field.__init__(self, *args, **kwargs)
+        self.big = big
+        Field.__init__(self, verbose_name, name, **kwargs)
 
     def get_internal_type(self):
-        return "AutoField"
+        return 'AutoField' if not self.big else 'BigAutoField'
+
+    def rel_db_type(self, connection):
+        db_type = 'IntegerField' if not self.big else 'BigIntegerField'
+        return self._internal_to_db_type(db_type, connection)
 
     def to_python(self, value):
         if value is None:
@@ -1142,6 +1156,11 @@ class PositiveIntegerField(IntegerField):
     def get_internal_type(self):
         return "PositiveIntegerField"
 
+    def rel_db_type(self, connection):
+        if connection.features.related_fields_match_type:
+            return self.db_type(connection)
+        return self._internal_to_db_type('IntegerField', connection)
+
     def formfield(self, **kwargs):
         defaults = {'min_value': 0}
         defaults.update(kwargs)
@@ -1153,6 +1172,11 @@ class PositiveSmallIntegerField(IntegerField):
     def get_internal_type(self):
         return "PositiveSmallIntegerField"
 
+    def rel_db_type(self, connection):
+        if connection.features.related_fields_match_type:
+            return self.db_type(connection)
+        return self._internal_to_db_type('IntegerField', connection)
+
     def formfield(self, **kwargs):
         defaults = {'min_value': 0}
         defaults.update(kwargs)
diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py
index 08cc0a7..aa721ec 100644
--- a/django/db/models/fields/related.py
+++ b/django/db/models/fields/related.py
@@ -1043,12 +1043,9 @@ class ForeignKey(RelatedField, Field):
         # If the database needs similar types for key fields however, the only
         # thing we can do is making AutoField an IntegerField.
         rel_field = self.rel.get_related_field()
-        if (isinstance(rel_field, AutoField) or
-                (not connection.features.related_fields_match_type and
-                isinstance(rel_field, (PositiveIntegerField,
-                                       PositiveSmallIntegerField)))):
-            return IntegerField().db_type(connection=connection)
-        return rel_field.db_type(connection=connection)
+
+        return rel_field.rel_db_type(connection=connection)
+
 
 class OneToOneField(ForeignKey):
     """
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
index 275c696..44b4eb4 100644
--- a/docs/ref/models/fields.txt
+++ b/docs/ref/models/fields.txt
@@ -320,13 +320,22 @@ Field types
 ``AutoField``
 -------------
 
-.. class:: AutoField(**options)
+.. class:: AutoField([big=False, **options])
 
 An :class:`IntegerField` that automatically increments
 according to available IDs. You usually won't need to use this directly; a
 primary key field will automatically be added to your model if you don't specify
 otherwise. See :ref:`automatic-primary-key-fields`.
 
+.. attribute:: AutoField.big
+
+    .. versionadded:: 1.5
+
+    Optional.  Either ``False`` or ``True``.  Default is ``False``. Allow you
+    to use bigint for storing field values. This extends values range up to
+    max 64 bit integer (from 1 to 9223372036854775807).
+
+
 ``BigIntegerField``
 -------------------
 
diff --git a/tests/modeltests/bigautofield/__init__.py b/tests/modeltests/bigautofield/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/modeltests/bigautofield/models.py b/tests/modeltests/bigautofield/models.py
new file mode 100644
index 0000000..95cf8c9
--- /dev/null
+++ b/tests/modeltests/bigautofield/models.py
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+from django.db import models
+from django.utils.encoding import python_2_unicode_compatible
+
+
+@python_2_unicode_compatible
+class Village(models.Model):
+    name = models.CharField(max_length=100)
+
+
+@python_2_unicode_compatible
+class Population(models.Model):
+    village = models.ForeignKey(Village)
+    total = models.IntegerField()
+
+
+@python_2_unicode_compatible
+class City(models.Model):
+    id = models.AutoField(primary_key=True, big=True)
+    name = models.CharField(max_length=100)
+
+
+@python_2_unicode_compatible
+class Weather(models.Model):
+    city = models.ForeignKey(City)
+    temp = models.IntegerField()
diff --git a/tests/modeltests/bigautofield/tests.py b/tests/modeltests/bigautofield/tests.py
new file mode 100644
index 0000000..2aa2f4b
--- /dev/null
+++ b/tests/modeltests/bigautofield/tests.py
@@ -0,0 +1,57 @@
+from __future__ import absolute_import, unicode_literals
+
+from django.db import connection
+from django.test import TestCase, skipUnlessDBFeature
+
+from .models import Village, Population, City, Weather
+
+
+class BigAutoFieldTest(TestCase):
+
+    def test_type(self):
+        field = Village._meta.get_field_by_name('id')[0]
+        self.assertEqual(field.get_internal_type(), 'AutoField')
+        types = {
+            'mysql': 'integer AUTO_INCREMENT', 'oracle': 'NUMBER(11)',
+            'postgresql': 'serial', 'sqlite': 'integer',
+        }
+        self.assertEqual(field.db_type(connection), types[connection.vendor])
+
+        field = Population._meta.get_field_by_name('village')[0]
+        types = {
+            'mysql': 'integer', 'oracle': 'NUMBER(11)',
+            'postgresql': 'integer', 'sqlite': 'integer',
+        }
+        self.assertEqual(field.db_type(connection), types[connection.vendor])
+
+    def test_big_type(self):
+
+        field = City._meta.get_field_by_name('id')[0]
+        self.assertEqual(field.get_internal_type(), 'BigAutoField')
+        types = {
+            'mysql': 'bigint AUTO_INCREMENT', 'oracle': 'NUMBER(19)',
+            'postgresql': 'bigserial', 'sqlite': 'integer',
+        }
+        self.assertEqual(field.db_type(connection), types[connection.vendor])
+
+        field = Weather._meta.get_field_by_name('city')[0]
+        types = {
+            'mysql': 'bigint', 'oracle': 'NUMBER(19)',
+            'postgresql': 'bigint', 'sqlite': 'bigint',
+        }
+        self.assertEqual(field.db_type(connection), types[connection.vendor])
+
+    def test_usage(self):
+        city_id = 8223372036854775807
+        c = City.objects.create(id=city_id, name='Moscow')
+        Weather.objects.create(city=c, temp=17)
+
+        c = City.objects.get(id=city_id)
+        w = Weather.objects.get(city_id=city_id)
+        self.assertEqual(c.id, city_id)
+        self.assertEqual(w.city_id, city_id)
+
+        c.delete()
+
+        with self.assertRaises(Weather.DoesNotExist):
+            Weather.objects.get(city_id=city_id)
