diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index d435675..5d9a2f4 100644
--- a/django/contrib/admin/options.py
+++ b/django/contrib/admin/options.py
@@ -28,7 +28,6 @@ from django.forms.models import (modelform_factory, modelformset_factory,
     inlineformset_factory, BaseInlineFormSet, modelform_defines_fields)
 from django.http import Http404, HttpResponseRedirect
 from django.http.response import HttpResponseBase
-from django.shortcuts import get_object_or_404
 from django.template.response import SimpleTemplateResponse, TemplateResponse
 from django.utils.decorators import method_decorator
 from django.utils.html import escape, escapejs
@@ -1517,7 +1516,9 @@ class ModelAdmin(BaseModelAdmin):
         from django.contrib.admin.models import LogEntry
         # First check if the user can see this history.
         model = self.model
-        obj = get_object_or_404(model, pk=unquote(object_id))
+        obj = self.get_object(request, unquote(object_id))
+        if obj is None:
+            raise Http404('No %s matches the given query.' % model._meta.object_name)
 
         if not self.has_change_permission(request, obj):
             raise PermissionDenied
diff --git a/tests/admin_views/admin.py b/tests/admin_views/admin.py
index b2da23f..a3ce942 100644
--- a/tests/admin_views/admin.py
+++ b/tests/admin_views/admin.py
@@ -29,8 +29,8 @@ from .models import (Article, Chapter, Account, Media, Child, Parent, Picture,
     Album, Question, Answer, ComplexSortedPerson, PluggableSearchPerson, PrePopulatedPostLargeSlug,
     AdminOrderedField, AdminOrderedModelMethod, AdminOrderedAdminMethod,
     AdminOrderedCallable, Report, Color2, UnorderedObject, MainPrepopulated,
-    RelatedPrepopulated, UndeletableObject, UnchangeableObject, UserMessenger, Simple, Choice,
-    ShortMessage, Telegram)
+    RelatedPrepopulated, UndeletableObject, UnchangeableObject, UserMessenger,
+    Simple, FilteredManager, Choice, ShortMessage, Telegram)
 
 
 def callable_year(dt_value):
@@ -674,6 +674,10 @@ def callable_on_unknown(obj):
 class AttributeErrorRaisingAdmin(admin.ModelAdmin):
     list_display = [callable_on_unknown, ]
 
+class CustomManagerAdmin(admin.ModelAdmin):
+    def get_queryset(self, request):
+        return FilteredManager.objects
+
 class MessageTestingAdmin(admin.ModelAdmin):
     actions = ["message_debug", "message_info", "message_success",
                "message_warning", "message_error", "message_extra_tags"]
@@ -781,6 +785,7 @@ site.register(AdminOrderedAdminMethod, AdminOrderedAdminMethodAdmin)
 site.register(AdminOrderedCallable, AdminOrderedCallableAdmin)
 site.register(Color2, CustomTemplateFilterColorAdmin)
 site.register(Simple, AttributeErrorRaisingAdmin)
+site.register(FilteredManager, CustomManagerAdmin)
 site.register(UserMessenger, MessageTestingAdmin)
 site.register(Choice, ChoiceList)
 
diff --git a/tests/admin_views/models.py b/tests/admin_views/models.py
index 6483fc8..40336c1 100644
--- a/tests/admin_views/models.py
+++ b/tests/admin_views/models.py
@@ -690,6 +690,17 @@ class Simple(models.Model):
     Simple model with nothing on it for use in testing
     """
 
+class _Manager(models.Manager):
+    def get_queryset(self):
+        return super(_Manager, self).get_queryset().filter(pk__gt=1)
+
+class FilteredManager(models.Model):
+    def __str__(self):
+        return "PK=%d" % self.pk
+
+    pk_gt_1 = _Manager()
+    objects = models.Manager()
+
 class Choice(models.Model):
     choice = models.IntegerField(blank=True, null=True,
         choices=((1, 'Yes'), (0, 'No'), (None, 'No opinion')))
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index aa5f9ec..2873cae 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -51,7 +51,7 @@ from .models import (Article, BarAccount, CustomArticle, EmptyModel, FooAccount,
     AdminOrderedModelMethod, AdminOrderedAdminMethod, AdminOrderedCallable,
     Report, MainPrepopulated, RelatedPrepopulated, UnorderedObject,
     Simple, UndeletableObject, UnchangeableObject, Choice, ShortMessage,
-    Telegram, Pizza, Topping)
+    Telegram, Pizza, Topping, FilteredManager)
 from .admin import site, site2
 
 
@@ -1212,6 +1212,16 @@ class AdminViewPermissionsTest(TestCase):
 
             self.client.get('/test_admin/admin/logout/')
 
+    def testHistoryViewCustomQueryset(self):
+        self.client.post('/test_admin/admin/', self.super_login)
+        FilteredManager.objects.create(pk=1)
+        FilteredManager.objects.create(pk=2)
+        response = self.client.get('/test_admin/admin/admin_views/filteredmanager/')
+        self.assertContains(response, "PK=1")
+        self.assertContains(response, "PK=2")
+        self.assertEqual(self.client.get('/test_admin/admin/admin_views/filteredmanager/1/history/').status_code, 200)
+        self.assertEqual(self.client.get('/test_admin/admin/admin_views/filteredmanager/2/history/').status_code, 200)
+
     def testConditionallyShowAddSectionLink(self):
         """
         The foreign key widget should only show the "add related" button if the
