diff --git a/django/core/urlresolvers.py b/django/core/urlresolvers.py
index 424886e..54d6177 100644
--- a/django/core/urlresolvers.py
+++ b/django/core/urlresolvers.py
@@ -303,6 +303,9 @@ class RegexURLResolver(object):
         return self._resolve_special('500')
 
     def reverse(self, lookup_view, *args, **kwargs):
+        return self._reverse_with_prefix(lookup_view, '', *args, **kwargs)
+        
+    def _reverse_with_prefix(self, lookup_view, _prefix, *args, **kwargs):
         if args and kwargs:
             raise ValueError("Don't mix *args and **kwargs in call to reverse()!")
         try:
@@ -310,15 +313,16 @@ class RegexURLResolver(object):
         except (ImportError, AttributeError), e:
             raise NoReverseMatch("Error importing '%s': %s." % (lookup_view, e))
         possibilities = self.reverse_dict.getlist(lookup_view)
+        prefix_norm, prefix_args = normalize(_prefix)[0]
         for possibility, pattern, defaults in possibilities:
             for result, params in possibility:
                 if args:
-                    if len(args) != len(params):
+                    if len(args) != len(params) + len(prefix_args):
                         continue
                     unicode_args = [force_unicode(val) for val in args]
-                    candidate =  result % dict(zip(params, unicode_args))
+                    candidate =  (prefix_norm + result) % dict(zip(params, unicode_args))
                 else:
-                    if set(kwargs.keys() + defaults.keys()) != set(params + defaults.keys()):
+                    if set(kwargs.keys() + defaults.keys()) != set(params + defaults.keys() + prefix_args):
                         continue
                     matches = True
                     for k, v in defaults.items():
@@ -328,8 +332,8 @@ class RegexURLResolver(object):
                     if not matches:
                         continue
                     unicode_kwargs = dict([(k, force_unicode(v)) for (k, v) in kwargs.items()])
-                    candidate = result % unicode_kwargs
-                if re.search(u'^%s' % pattern, candidate, re.UNICODE):
+                    candidate = (prefix_norm + result) % unicode_kwargs
+                if re.search(u'^%s%s' % (_prefix, pattern), candidate, re.UNICODE):
                     return candidate
         # lookup_view can be URL label, or dotted path, or callable, Any of
         # these can be passed in at the top, but callables are not friendly in
@@ -394,8 +398,7 @@ def reverse(viewname, urlconf=None, args=None, kwargs=None, prefix=None, current
                 else:
                     raise NoReverseMatch("%s is not a registered namespace" % key)
 
-    return iri_to_uri(u'%s%s' % (prefix, resolver.reverse(view,
-            *args, **kwargs)))
+    return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
 
 reverse_lazy = lazy(reverse, str)
 
diff --git a/tests/regressiontests/urlpatterns_reverse/namespace_urls.py b/tests/regressiontests/urlpatterns_reverse/namespace_urls.py
index 3d34049..0544e75 100644
--- a/tests/regressiontests/urlpatterns_reverse/namespace_urls.py
+++ b/tests/regressiontests/urlpatterns_reverse/namespace_urls.py
@@ -37,11 +37,12 @@ urlpatterns = patterns('regressiontests.urlpatterns_reverse.views',
     (r'^default/', include(default_testobj.urls)),
 
     (r'^other1/', include(otherobj1.urls)),
-    (r'^other2/', include(otherobj2.urls)),
+    (r'^other[246]/', include(otherobj2.urls)),
 
-    (r'^ns-included1/', include('regressiontests.urlpatterns_reverse.included_namespace_urls', namespace='inc-ns1')),
+    (r'^ns-included[135]/', include('regressiontests.urlpatterns_reverse.included_namespace_urls', namespace='inc-ns1')),
     (r'^ns-included2/', include('regressiontests.urlpatterns_reverse.included_namespace_urls', namespace='inc-ns2')),
 
     (r'^included/', include('regressiontests.urlpatterns_reverse.included_namespace_urls')),
+    (r'^inc(?P<outer>\d+)/', include('regressiontests.urlpatterns_reverse.included_urls', namespace='inc-ns5')),
 
 )
diff --git a/tests/regressiontests/urlpatterns_reverse/tests.py b/tests/regressiontests/urlpatterns_reverse/tests.py
index 31a928c..4bdfad8 100644
--- a/tests/regressiontests/urlpatterns_reverse/tests.py
+++ b/tests/regressiontests/urlpatterns_reverse/tests.py
@@ -49,6 +49,11 @@ resolve_test_data = (
     # Nested namespaces
     ('/ns-included1/test3/inner/42/37/', 'urlobject-view', 'testapp', 'inc-ns1:test-ns3', 'empty_view', tuple(), {'arg1': '42', 'arg2': '37'}),
     ('/ns-included1/ns-included4/ns-included2/test3/inner/42/37/', 'urlobject-view', 'testapp', 'inc-ns1:inc-ns4:inc-ns2:test-ns3', 'empty_view', tuple(), {'arg1': '42', 'arg2': '37'}),
+
+    # Namespaces capturing variables 
+    ('/inc70/', 'inner-nothing', None, 'inc-ns5', views.empty_view, tuple(), {'outer': '70'}),
+    ('/inc78/extra/foobar/', 'inner-extra', None, 'inc-ns5', views.empty_view, tuple(), {'outer':'78', 'extra':'foobar'}),
+
 )
 
 test_data = (
