diff --git a/django/template/base.py b/django/template/base.py
index 1440869..d865f1d 100644
--- a/django/template/base.py
+++ b/django/template/base.py
@@ -796,18 +796,23 @@ class VariableNode(Node):
             return ''
         return _render_value_in_context(output, context)
 
-def generic_tag_compiler(params, defaults, name, node_class, parser, token):
+def generic_tag_compiler(params, defaults, name, node_class, parser, token, varargs=None):
     "Returns a template.Node subclass."
     bits = token.split_contents()[1:]
     bmax = len(params)
     def_len = defaults and len(defaults) or 0
     bmin = bmax - def_len
-    if(len(bits) < bmin or len(bits) > bmax):
-        if bmin == bmax:
-            message = "%s takes %s arguments" % (name, bmin)
-        else:
-            message = "%s takes between %s and %s arguments" % (name, bmin, bmax)
-        raise TemplateSyntaxError(message)
+    if varargs is None:
+        if(len(bits) < bmin or len(bits) > bmax):
+            if bmin == bmax:
+                message = "%s takes %s arguments" % (name, bmin)
+            else:
+                message = "%s takes between %s and %s arguments" % (name, bmin, bmax)
+            raise TemplateSyntaxError(message)
+    else:
+        if(len(bits) < bmin):
+            message = "%s takes at least %s arguments" % (name, bmin)
+            raise TemplateSyntaxError(message)
     return node_class(bits)
 
 class Library(object):
@@ -865,7 +870,7 @@ class Library(object):
 
     def simple_tag(self, func=None, takes_context=None):
         def dec(func):
-            params, xx, xxx, defaults = getargspec(func)
+            params, varargs, xxx, defaults = getargspec(func)
             if takes_context:
                 if params[0] == 'context':
                     params = params[1:]
@@ -884,7 +889,7 @@ class Library(object):
                         func_args = resolved_vars
                     return func(*func_args)
 
-            compile_func = curry(generic_tag_compiler, params, defaults, getattr(func, "_decorated_function", func).__name__, SimpleNode)
+            compile_func = curry(generic_tag_compiler, params, defaults, getattr(func, "_decorated_function", func).__name__, SimpleNode, varargs=varargs)
             compile_func.__doc__ = func.__doc__
             self.tag(getattr(func, "_decorated_function", func).__name__, compile_func)
             return func
@@ -900,7 +905,7 @@ class Library(object):
 
     def inclusion_tag(self, file_name, context_class=Context, takes_context=False):
         def dec(func):
-            params, xx, xxx, defaults = getargspec(func)
+            params, varargs, xxx, defaults = getargspec(func)
             if takes_context:
                 if params[0] == 'context':
                     params = params[1:]
@@ -935,8 +940,7 @@ class Library(object):
                     if csrf_token is not None:
                         new_context['csrf_token'] = csrf_token
                     return self.nodelist.render(new_context)
-
-            compile_func = curry(generic_tag_compiler, params, defaults, getattr(func, "_decorated_function", func).__name__, InclusionNode)
+            compile_func = curry(generic_tag_compiler, params, defaults, getattr(func, "_decorated_function", func).__name__, InclusionNode, varargs=varargs)
             compile_func.__doc__ = func.__doc__
             self.tag(getattr(func, "_decorated_function", func).__name__, compile_func)
             return func
diff --git a/tests/regressiontests/templates/templatetags/custom.py b/tests/regressiontests/templates/templatetags/custom.py
index 7011316..87aeb83 100644
--- a/tests/regressiontests/templates/templatetags/custom.py
+++ b/tests/regressiontests/templates/templatetags/custom.py
@@ -39,3 +39,60 @@ def params_and_context(context, arg):
     return "params_and_context - Expected result (context value: %s): %s" % (context['value'], arg)
 params_and_context.anything = "Expected params_and_context __dict__"
 
+
+def simple_tag_with_three_arguments(one, two, three):
+    return ', '.join((one, two, three))
+
+register.simple_tag(simple_tag_with_three_arguments)
+
+
+def simple_tag_with_two_default_arguments(one, two='2', three='3'):
+    return ', '.join((one, two, three))
+
+register.simple_tag(simple_tag_with_two_default_arguments)
+
+
+def simple_tag_with_unlimited_arguments(one, two='2', *args):
+    return ', '.join([one, two] + list(args))
+
+register.simple_tag(simple_tag_with_unlimited_arguments)
+
+
+def simple_tag_with_only_unlimited_arguments(*args):
+	return ', '.join(args)
+
+register.simple_tag(simple_tag_with_only_unlimited_arguments)
+
+
+def inclusion_tag_with_two_arguments(one, two):
+    return {
+        'first': one,
+        'second': two
+    }
+
+register.inclusion_tag('basic-syntax03')(inclusion_tag_with_two_arguments)
+
+
+def inclusion_tag_with_one_default_argument(one, two='hi'):
+    return {
+        'first': one,
+        'second': two
+    }
+
+register.inclusion_tag('basic-syntax03')(inclusion_tag_with_one_default_argument)
+
+
+def inclusion_tag_with_unlimited_arguments(one, two='hi', *args):
+    return {
+        'values': [one, two] + list(args)
+    }
+
+register.inclusion_tag('for-tag01')(inclusion_tag_with_unlimited_arguments)
+
+
+def inclusion_tag_with_only_unlimited_arguments(*args):
+    return {
+        'values': args
+    }
+
+register.inclusion_tag('for-tag01')(inclusion_tag_with_only_unlimited_arguments)
\ No newline at end of file
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index 99b4367..0e6e2b6 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -1526,6 +1526,56 @@ class Templates(unittest.TestCase):
             'static-prefixtag02': ('{% load static %}{% get_static_prefix as static_prefix %}{{ static_prefix }}', {}, settings.STATIC_URL),
             'static-prefixtag03': ('{% load static %}{% get_media_prefix %}', {}, settings.MEDIA_URL),
             'static-prefixtag04': ('{% load static %}{% get_media_prefix as media_prefix %}{{ media_prefix }}', {}, settings.MEDIA_URL),
+
+
+            ### SIMPLE TAGS ######################################################
+            'simpletags01': ('{% load custom %}{% simple_tag_with_three_arguments "one" "two" "three" %}', {}, 'one, two, three'),
+            'simpletags02': ('{% load custom %}{% simple_tag_with_three_arguments one two three %}', {'one': '1', 'two': '2', 'three': '3'}, '1, 2, 3'),
+
+            # Default arguments
+            'simpletags-default01': ('{% load custom %}{% simple_tag_with_two_default_arguments "one" "two" "three" %}', {}, 'one, two, three'),
+            'simpletags-default02': ('{% load custom %}{% simple_tag_with_two_default_arguments one three %}', {'one': '1', 'two': '2', 'three': '3'}, '1, 3, 3'),
+            'simpletags-default03': ('{% load custom %}{% simple_tag_with_two_default_arguments one %}', {'one': 'first'}, 'first, 2, 3'),
+
+            # Unlimited arguments
+            'simpletags-unlimited01': ('{% load custom %}{% simple_tag_with_unlimited_arguments "one" "two" "three" %}', {}, 'one, two, three'),
+            'simpletags-unlimited02': ('{% load custom %}{% simple_tag_with_unlimited_arguments "one" %}', {}, 'one, 2'),
+            'simpletags-unlimited03': ('{% load custom %}{% simple_tag_with_unlimited_arguments one two three four five %}', {'one': '1', 'two': '2', 'three': '3', 'four': '4', 'five': '5'}, '1, 2, 3, 4, 5'),
+            'simpletags-unlimited04': ('{% load custom %}{% simple_tag_with_unlimited_arguments one %}', {'one': 'first'}, 'first, 2'),
+            'simpletags-unlimited05': ('{% load custom %}{% simple_tag_with_only_unlimited_arguments one %}', {'one': 'first'}, 'first'),
+            'simpletags-unlimited06': ('{% load custom %}{% simple_tag_with_only_unlimited_arguments %}', {}, ''),
+            'simpletags-unlimited07': ('{% load custom %}{% simple_tag_with_only_unlimited_arguments "one" "2" "3" %}', {}, 'one, 2, 3'),
+
+            # Failures
+            'simpletags-fail01': ('{% load custom %}{% simple_tag_with_three_arguments "one" "three" %}', {}, template.TemplateSyntaxError),
+            'simpletags-fail02': ('{% load custom %}{% simple_tag_with_three_arguments "one" "two" "three" "four" %}', {}, template.TemplateSyntaxError),
+            'simpletags-fail03': ('{% load custom %}{% simple_tag_with_two_default_arguments %}', {}, template.TemplateSyntaxError),
+            'simpletags-fail04': ('{% load custom %}{% simple_tag_with_two_default_arguments "one" "two" "three" "four" %}', {}, template.TemplateSyntaxError),
+            'simpletags-fail05': ('{% load custom %}{% simple_tag_with_unlimited_arguments %}', {}, template.TemplateSyntaxError),
+
+
+
+            ### INCLUSION TAGS ######################################################
+            'inclusiontags01': ('{% load custom %}{% inclusion_tag_with_two_arguments "1" "2" %}', {}, "1 --- 2"),
+            'inclusiontags02': ('{% load custom %}{% inclusion_tag_with_two_arguments "1" two %}', {'two': '2'}, "1 --- 2"),
+
+            # Default arguments
+            'inclusiontags-default01': ('{% load custom %}{% inclusion_tag_with_one_default_argument "1" "2" %}', {}, "1 --- 2"),
+            'inclusiontags-default02': ('{% load custom %}{% inclusion_tag_with_one_default_argument one %}', {'one': "1"}, "1 --- hi"),
+
+            # Unlimited arguments
+            'inclusiontags-unlimited01': ('{% load custom %}{% inclusion_tag_with_unlimited_arguments "1" "2" %}', {}, "12"),
+            'inclusiontags-unlimited02': ('{% load custom %}{% inclusion_tag_with_unlimited_arguments one %}', {'one': 'first'}, "firsthi"),
+            'inclusiontags-unlimited03': ('{% load custom %}{% inclusion_tag_with_unlimited_arguments "1" "2" "3" "5" "7" %}', {}, "12357"),
+            'inclusiontags-unlimited04': ('{% load custom %}{% inclusion_tag_with_only_unlimited_arguments %}', {}, ""),
+            'inclusiontags-unlimited05': ('{% load custom %}{% inclusion_tag_with_only_unlimited_arguments "1" "2" "3" "5" hello %}', {'hello': 'hello'}, "1235hello"),
+
+            # Failures
+            'inclusiontags-fail01': ('{% load custom %}{% inclusion_tag_with_two_arguments "1" %}', {}, template.TemplateSyntaxError),
+            'inclusiontags-fail02': ('{% load custom %}{% inclusion_tag_with_two_arguments "1" two "3" %}', {'two': '2'}, template.TemplateSyntaxError),
+            'inclusiontags-fail03': ('{% load custom %}{% inclusion_tag_with_one_default_argument %}', {}, template.TemplateSyntaxError),
+            'inclusiontags-fail04': ('{% load custom %}{% inclusion_tag_with_one_default_argument "1" two "3" %}', {'two': '2'}, template.TemplateSyntaxError),
+            'inclusiontags-fail05': ('{% load custom %}{% inclusion_tag_with_unlimited_arguments %}', {}, template.TemplateSyntaxError),
         }
 
 class TemplateTagLoading(unittest.TestCase):
