diff --git a/hgext/__init__.py b/hgext3rd/__init__.py
similarity index 80%
copy from hgext/__init__.py
copy to hgext3rd/__init__.py
index 012411b9940d7c87d2d27e866ae54e942113a59b_aGdleHQvX19pbml0X18ucHk=..4b81487a01d4bc69cc80607d7f05a3883d79875a_aGdleHQzcmQvX19pbml0X18ucHk= 100644
--- a/hgext/__init__.py
+++ b/hgext3rd/__init__.py
@@ -1,3 +1,4 @@
+# name space package to host third party extensions
 from __future__ import absolute_import
 import pkgutil
 __path__ = pkgutil.extend_path(__path__, __name__)
diff --git a/mercurial/extensions.py b/mercurial/extensions.py
index 012411b9940d7c87d2d27e866ae54e942113a59b_bWVyY3VyaWFsL2V4dGVuc2lvbnMucHk=..4b81487a01d4bc69cc80607d7f05a3883d79875a_bWVyY3VyaWFsL2V4dGVuc2lvbnMucHk= 100644
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -105,7 +105,11 @@
             mod = _importh("hgext.%s" % name)
         except ImportError as err:
             _reportimporterror(ui, err, "hgext.%s" % name, name)
-            mod = _importh(name)
+            try:
+                mod = _importh("hgext3rd.%s" % name)
+            except ImportError as err:
+                _reportimporterror(ui, err, "hgext3rd.%s" % name, name)
+                mod = _importh(name)
 
     # Before we do anything with the extension, check against minimum stated
     # compatibility. This gives extension authors a mechanism to have their
diff --git a/setup.py b/setup.py
index 012411b9940d7c87d2d27e866ae54e942113a59b_c2V0dXAucHk=..4b81487a01d4bc69cc80607d7f05a3883d79875a_c2V0dXAucHk= 100644
--- a/setup.py
+++ b/setup.py
@@ -506,7 +506,7 @@
 packages = ['mercurial', 'mercurial.hgweb', 'mercurial.httpclient',
             'mercurial.pure',
             'hgext', 'hgext.convert', 'hgext.highlight', 'hgext.zeroconf',
-            'hgext.largefiles']
+            'hgext.largefiles', 'hgext3rd']
 
 common_depends = ['mercurial/util.h']
 
diff --git a/tests/test-bad-extension.t b/tests/test-bad-extension.t
index 012411b9940d7c87d2d27e866ae54e942113a59b_dGVzdHMvdGVzdC1iYWQtZXh0ZW5zaW9uLnQ=..4b81487a01d4bc69cc80607d7f05a3883d79875a_dGVzdHMvdGVzdC1iYWQtZXh0ZW5zaW9uLnQ= 100644
--- a/tests/test-bad-extension.t
+++ b/tests/test-bad-extension.t
@@ -56,6 +56,9 @@
   could not import hgext.badext2 (No module named *badext2): trying badext2 (glob)
   Traceback (most recent call last):
   ImportError: No module named *badext2 (glob)
+  could not import hgext3rd.badext2 (No module named badext2): trying badext2
+  Traceback (most recent call last):
+  ImportError: No module named badext2
   *** failed to import extension badext2: No module named badext2
   Traceback (most recent call last):
   ImportError: No module named badext2