diff --git a/django/template/base.py b/django/template/base.py
index b96e446..0cc2daa 100644
--- a/django/template/base.py
+++ b/django/template/base.py
@@ -799,18 +799,26 @@ class VariableNode(Node):
             return ''
         return _render_value_in_context(output, context)
 
-def generic_tag_compiler(params, defaults, name, node_class, parser, token):
-    "Returns a template.Node subclass."
-    bits = token.split_contents()[1:]
+def generic_tag_syntax_check(bits, params, defaults, name, varargs):
     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)
+
+def generic_tag_compiler(parser, token, params, defaults, name, node_class, varargs):
+    "Returns a template.Node subclass."
+    bits = token.split_contents()[1:]
+    generic_tag_syntax_check(bits, params, defaults, name, varargs)
     return node_class(bits)
 
 class Library(object):
@@ -868,7 +876,7 @@ class Library(object):
 
     def simple_tag(self, func=None, takes_context=None, name=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:]
@@ -888,7 +896,7 @@ class Library(object):
                     return func(*func_args)
 
             function_name = name or getattr(func, '_decorated_function', func).__name__
-            compile_func = partial(generic_tag_compiler, params, defaults, function_name, SimpleNode)
+            compile_func = partial(generic_tag_compiler, params=params, defaults=defaults, name=function_name, node_class=SimpleNode, varargs=varargs)
             compile_func.__doc__ = func.__doc__
             self.tag(function_name, compile_func)
             return func
@@ -904,7 +912,7 @@ class Library(object):
 
     def assignment_tag(self, func=None, takes_context=None, name=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:]
@@ -925,31 +933,19 @@ class Library(object):
                     context[self.target_var] = func(*func_args)
                     return ''
 
+            function_name = name or getattr(func, '_decorated_function', func).__name__
+
             def compile_func(parser, token):
-                bits = token.split_contents()
-                tag_name = bits[0]
-                bits = bits[1:]
-                params_max = len(params)
-                defaults_length = defaults and len(defaults) or 0
-                params_min = params_max - defaults_length
+                bits = token.split_contents()[1:]
                 if (len(bits) < 2 or bits[-2] != 'as'):
                     raise TemplateSyntaxError(
                         "'%s' tag takes at least 2 arguments and the "
-                        "second last argument must be 'as'" % tag_name)
-                params_vars = bits[:-2]
+                        "second last argument must be 'as'" % function_name)
                 target_var = bits[-1]
-                if (len(params_vars) < params_min or
-                        len(params_vars) > params_max):
-                    if params_min == params_max:
-                        raise TemplateSyntaxError(
-                            "%s takes %s arguments" % (tag_name, params_min))
-                    else:
-                        raise TemplateSyntaxError(
-                            "%s takes between %s and %s arguments"
-                            % (tag_name, params_min, params_max))
-                return AssignmentNode(params_vars, target_var)
+                args = bits[:-2]
+                generic_tag_syntax_check(args, params, defaults, function_name, varargs)
+                return AssignmentNode(args, target_var)
 
-            function_name = name or getattr(func, '_decorated_function', func).__name__
             compile_func.__doc__ = func.__doc__
             self.tag(function_name, compile_func)
             return func
@@ -965,7 +961,7 @@ class Library(object):
 
     def inclusion_tag(self, file_name, context_class=Context, takes_context=False, name=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:]
@@ -1008,7 +1004,7 @@ class Library(object):
                     return self.nodelist.render(new_context)
 
             function_name = name or getattr(func, '_decorated_function', func).__name__
-            compile_func = partial(generic_tag_compiler, params, defaults, function_name, InclusionNode)
+            compile_func = partial(generic_tag_compiler, params=params, defaults=defaults, name=function_name, node_class=InclusionNode, varargs=varargs)
             compile_func.__doc__ = func.__doc__
             self.tag(function_name, compile_func)
             return func
diff --git a/tests/regressiontests/templates/templatetags/custom.py b/tests/regressiontests/templates/templatetags/custom.py
index dfa4171..ce8588d 100644
--- a/tests/regressiontests/templates/templatetags/custom.py
+++ b/tests/regressiontests/templates/templatetags/custom.py
@@ -40,6 +40,22 @@ 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__"
 
+@register.simple_tag
+def simple_tag_with_three_arguments(one, two, three):
+    return ', '.join((one, two, three))
+
+@register.simple_tag
+def simple_tag_with_two_default_arguments(one, two='2', three='3'):
+    return ', '.join((one, two, three))
+
+@register.simple_tag
+def simple_tag_with_unlimited_arguments(one, two='2', *args):
+    return ', '.join([one, two] + list(args))
+
+@register.simple_tag
+def simple_tag_with_only_unlimited_arguments(*args):
+    return ', '.join(args)
+
 @register.inclusion_tag('inclusion.html')
 def inclusion_no_params():
     """Expected inclusion_no_params __doc__"""
@@ -100,6 +116,32 @@ def inclusion_params_and_context_from_template(context, arg):
     return {"result" : "inclusion_params_and_context_from_template - Expected result (context value: %s): %s" % (context['value'], arg)}
 inclusion_params_and_context_from_template.anything = "Expected inclusion_params_and_context_from_template __dict__"
 
+@register.inclusion_tag('basic-syntax03')
+def inclusion_tag_with_two_arguments(one, two):
+    return {
+        'first': one,
+        'second': two
+    }
+
+@register.inclusion_tag('basic-syntax03')
+def inclusion_tag_with_one_default_argument(one, two='hi'):
+    return {
+        'first': one,
+        'second': two
+    }
+
+@register.inclusion_tag('for-tag01')
+def inclusion_tag_with_unlimited_arguments(one, two='hi', *args):
+    return {
+        'values': [one, two] + list(args)
+    }
+
+@register.inclusion_tag('for-tag01')
+def inclusion_tag_with_only_unlimited_arguments(*args):
+    return {
+        'values': args
+    }
+
 @register.simple_tag(takes_context=True)
 def current_app(context):
     return "%s" % context.current_app
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index 36a1ca3..d959059 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -1608,6 +1608,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):
