diff --git a/AUTHORS b/AUTHORS
index a32e0d6..5c794c4 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -342,6 +342,7 @@ answer newbie questions, and generally made Django that much better:
     mattycakes@gmail.com
     Glenn Maynard <glenn@zewt.org>
     Jason McBrayer <http://www.carcosa.net/jason/>
+    Kevin McCarthy <me@kevinmccarthy.org>
     Kevin McConnell <kevin.mcconnell@gmail.com>
     mccutchen@gmail.com
     michael.mcewan@gmail.com
diff --git a/django/forms/formsets.py b/django/forms/formsets.py
index 3810ebf..b841eac 100644
--- a/django/forms/formsets.py
+++ b/django/forms/formsets.py
@@ -62,7 +62,7 @@ class BaseFormSet(StrAndUnicode):
 
     def _management_form(self):
         """Returns the ManagementForm instance for this FormSet."""
-        if self.is_bound:
+        if self.is_bound and not self.save_as_new:
             form = ManagementForm(self.data, auto_id=self.auto_id, prefix=self.prefix)
             if not form.is_valid():
                 raise ValidationError('ManagementForm data is missing or has been tampered with')
@@ -77,7 +77,7 @@ class BaseFormSet(StrAndUnicode):
 
     def total_form_count(self):
         """Returns the total number of forms in this FormSet."""
-        if self.is_bound:
+        if self.is_bound and not self.save_as_new:
             return self.management_form.cleaned_data[TOTAL_FORM_COUNT]
         else:
             initial_forms = self.initial_form_count()
diff --git a/tests/regressiontests/admin_inlines/models.py b/tests/regressiontests/admin_inlines/models.py
index ee0abd1..3101029 100644
--- a/tests/regressiontests/admin_inlines/models.py
+++ b/tests/regressiontests/admin_inlines/models.py
@@ -191,3 +191,21 @@ class NovelAdmin(admin.ModelAdmin):
 
 admin.site.register(Poll, PollAdmin)
 admin.site.register(Novel, NovelAdmin)
+
+# Models for #13223
+class Post(models.Model):
+    title = models.CharField(max_length=200)
+    slug = models.CharField(max_length=200, unique = True)
+
+class Block(models.Model):
+    post = models.ForeignKey(Post)
+    slug = models.CharField(max_length=200, unique = True)
+
+class BlockInline(admin.TabularInline):
+    model = Block
+
+class PostAdmin(admin.ModelAdmin):
+    save_as = True
+    inlines = [BlockInline]
+
+admin.site.register(Post,PostAdmin)
diff --git a/tests/regressiontests/admin_inlines/tests.py b/tests/regressiontests/admin_inlines/tests.py
index 067b3c5..2e2c8cd 100644
--- a/tests/regressiontests/admin_inlines/tests.py
+++ b/tests/regressiontests/admin_inlines/tests.py
@@ -4,7 +4,8 @@ from django.test import TestCase
 
 # local test models
 from models import (Holder, Inner, InnerInline, Holder2, Inner2, Holder3,
-    Inner3, Person, OutfitItem, Fashionista, Teacher, Parent, Child)
+    Inner3, Person, OutfitItem, Fashionista, Teacher, Parent, Child,
+    Block, Post)
 
 
 class TestInline(TestCase):
@@ -103,6 +104,46 @@ class TestInline(TestCase):
         # column cells
         self.assertContains(response, '<p>Callable in QuestionInline</p>')
 
+    def test_inline_save_as(self):
+        """#13223 - ValueError with inline and save as new"""
+        p = Post.objects.create(title='test', slug='test')
+        b1 = p.block_set.create(slug='test1')
+        b2 = p.block_set.create(slug='test2')
+        b3 = p.block_set.create(slug='test3')
+        data = {
+            'block_set-TOTAL_FORMS': 6,
+            'block_set-INITIAL_FORMS': 3,
+            'block_set-MAX_NUM_FORMS': 0,
+            'block_set-0-id': b1.id,
+            'block_set-0-post': p.id,
+            'block_set-0-slug': b1.slug,
+            'block_set-1-id': b2.id,
+            'block_set-1-post': p.id,
+            'block_set-1-slug': b2.slug,
+            'block_set-2-id': b2.id,
+            'block_set-2-post': p.id,
+            'block_set-2-slug': b2.slug,
+            'block_set-3-id': '',
+            'block_set-3-post': p.id,
+            'block_set-3-slug': '',
+            'block_set-4-id': '',
+            'block_set-4-post': p.id,
+            'block_set-4-slug': '',
+            'block_set-5-id': '',
+            'block_set-5-post': p.id,
+            'block_set-5-slug': '',
+            'block_set-__prefix__-id': '',
+            'block_set-__prefix__-post': p.id,
+            'block_set-__prefix__-slug': '',
+            '_saveasnew': u'Save as new',
+        }
+        response = self.client.post('/test_admin/admin/admin_inlines/post/%s/' % p.id, data)
+        self.assertEqual(response.status_code, 200)
+        self.assertContains(response, '<input type="hidden" name="block_set-TOTAL_FORMS" value="3" id="id_block_set-TOTAL_FORMS" />')
+        self.assertContains(response, '<input type="hidden" name="block_set-INITIAL_FORMS" value="0" id="id_block_set-INITIAL_FORMS" />')
+        self.assertContains(response, '<input type="hidden" name="block_set-MAX_NUM_FORMS" id="id_block_set-MAX_NUM_FORMS" />')
+
+
 class TestInlineMedia(TestCase):
     fixtures = ['admin-views-users.xml']
 
