Index: django/template/defaulttags.py
===================================================================
--- django/template/defaulttags.py	(revision 6996)
+++ django/template/defaulttags.py	(working copy)
@@ -162,10 +162,12 @@
         self.nodelist = nodelist
         self._last_seen = None
         self._varlist = map(Variable, varlist)
-
+        self._id = str(id(self))
+        
     def render(self, context):
-        if 'forloop' in context and context['forloop']['first']:
+        if 'forloop' in context and self._id not in context['forloop']:
             self._last_seen = None
+            context['forloop'][self._id] = self
         try:
             if self._varlist:
                 # Consider multiple parameters.  This automatically behaves
Index: tests/regressiontests/templates/tests.py
===================================================================
--- tests/regressiontests/templates/tests.py	(revision 6996)
+++ tests/regressiontests/templates/tests.py	(working copy)
@@ -544,6 +544,14 @@
             'ifchanged06': ('{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% for x in numx %}{% ifchanged %}{{ x }}{% endifchanged %}{% endfor %}{% endfor %}', { 'num': (1, 1, 1), 'numx': (2, 2, 2)}, '1222'),
             'ifchanged07': ('{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% for x in numx %}{% ifchanged %}{{ x }}{% endifchanged %}{% for y in numy %}{% ifchanged %}{{ y }}{% endifchanged %}{% endfor %}{% endfor %}{% endfor %}', { 'num': (1, 1, 1), 'numx': (2, 2, 2), 'numy': (3, 3, 3)}, '1233323332333'),
 
+            'ifchanged08': (
+                '{% for data in datalist %}'
+                    '{% for c,d in data %}'
+                        '{% if c %}{% ifchanged %}{{ d }}{% endifchanged %}{% endif %}'
+                    '{% endfor %}'
+                '{% endfor %}',
+                { 'datalist': [[(1,'a'),(1,'a'),(0,'b'),(1,'c')],[(0,'a'),(1,'c'),(1,'d'),(1,'d'),(0,'e')]] }, 'accd'),
+
             # Test one parameter given to ifchanged.
             'ifchanged-param01': ('{% for n in num %}{% ifchanged n %}..{% endifchanged %}{{ n }}{% endfor %}', { 'num': (1,2,3) }, '..1..2..3'),
             'ifchanged-param02': ('{% for n in num %}{% for x in numx %}{% ifchanged n %}..{% endifchanged %}{{ x }}{% endfor %}{% endfor %}', { 'num': (1,2,3), 'numx': (5,6,7) }, '..567..567..567'),
