diff --git a/delta_diff_generator.cc b/delta_diff_generator.cc
index d42b296..ef7fdee 100644
--- a/delta_diff_generator.cc
+++ b/delta_diff_generator.cc
@@ -604,13 +604,19 @@
 
 // Remove identical corresponding block ranges in |src_extents| and
 // |dst_extents|. Used for preventing moving of blocks onto themselves during
-// MOVE operations.
-void RemoveIdenticalBlockRanges(vector<Extent>* src_extents,
-                                vector<Extent>* dst_extents) {
+// MOVE operations. The value of |total_bytes| indicates the actual length of
+// content; this may be slightly less than the total size of blocks, in which
+// case the last block is only partly occupied with data. Returns the total
+// number of bytes removed.
+size_t RemoveIdenticalBlockRanges(vector<Extent>* src_extents,
+                                  vector<Extent>* dst_extents,
+                                  const size_t total_bytes) {
   size_t src_idx = 0;
   size_t dst_idx = 0;
   uint64_t src_offset = 0, dst_offset = 0;
   bool new_src = true, new_dst = true;
+  size_t removed_bytes = 0, nonfull_block_bytes;
+  bool do_remove = false;
   while (src_idx < src_extents->size() && dst_idx < dst_extents->size()) {
     if (new_src) {
       src_offset = 0;
@@ -621,8 +627,8 @@
       new_dst = false;
     }
 
-    bool do_remove = ((*src_extents)[src_idx].start_block() + src_offset ==
-                      (*dst_extents)[dst_idx].start_block() + dst_offset);
+    do_remove = ((*src_extents)[src_idx].start_block() + src_offset ==
+                 (*dst_extents)[dst_idx].start_block() + dst_offset);
 
     uint64_t src_num_blocks = (*src_extents)[src_idx].num_blocks();
     uint64_t dst_num_blocks = (*dst_extents)[dst_idx].num_blocks();
@@ -637,7 +643,16 @@
                                       prev_src_offset, src_offset);
     new_dst = ProcessExtentBlockRange(dst_extents, &dst_idx, do_remove,
                                       prev_dst_offset, dst_offset);
+    if (do_remove)
+      removed_bytes += min_num_blocks * kBlockSize;
   }
+
+  // If we removed the last block and this block is only partly used by file
+  // content, deduct the unused portion from the total removed byte count.
+  if (do_remove && (nonfull_block_bytes = total_bytes % kBlockSize))
+    removed_bytes -= kBlockSize - nonfull_block_bytes;
+
+  return removed_bytes;
 }
 
 }  // namespace {}
@@ -762,8 +777,16 @@
 
   if (gather_extents) {
     // Remove identical src/dst block ranges in MOVE operations.
-    if (operation.type() == DeltaArchiveManifest_InstallOperation_Type_MOVE)
-      RemoveIdenticalBlockRanges(&src_extents, &dst_extents);
+    if (operation.type() == DeltaArchiveManifest_InstallOperation_Type_MOVE) {
+      size_t removed_bytes = RemoveIdenticalBlockRanges(
+          &src_extents, &dst_extents, new_data.size());
+
+      // Adjust the file length field accordingly.
+      if (removed_bytes) {
+        operation.set_src_length(old_data.size() - removed_bytes);
+        operation.set_dst_length(new_data.size() - removed_bytes);
+      }
+    }
 
     // Embed extents in the operation.
     DeltaDiffGenerator::StoreExtents(src_extents,
diff --git a/delta_diff_generator_unittest.cc b/delta_diff_generator_unittest.cc
index 7d9095e..65ca23f 100644
--- a/delta_diff_generator_unittest.cc
+++ b/delta_diff_generator_unittest.cc
@@ -139,25 +139,29 @@
   // Setup the old/new files so that it has immobile chunks; we make sure to
   // utilize all sub-cases of such chunks: blocks 21--22 induce a split (src)
   // and complete removal (dst), whereas blocks 24--25 induce trimming of the
-  // tail (src) and head (dst) of extents. The detailed configuration:
+  // tail (src) and head (dst) of extents. The final block (29) is used for
+  // ensuring we properly account for the number of bytes removed in cases where
+  // the last block is partly filled. The detailed configuration:
   //
-  // Old:  [ 20     21 22     23     24 25 ] [ 28 ]
-  // New:  [ 18 ] [ 21 22 ] [ 20 ] [ 24 25     26 ]
-  // Same:          ^^ ^^            ^^ ^^
+  // Old:  [ 20     21 22     23     24 25 ] [ 28     29 ]
+  // New:  [ 18 ] [ 21 22 ] [ 20 ] [ 24 25     26 ] [ 29 ]
+  // Same:          ^^ ^^            ^^ ^^            ^^
   vector<Extent> old_extents;
   uint64_t num_extents = 0;
   num_extents += AddExtent(20, 6, &old_extents);
-  num_extents += AddExtent(28, 1, &old_extents);
+  num_extents += AddExtent(28, 2, &old_extents);
   fake_file_extents[old_path()] = &old_extents;
   vector<Extent> new_extents;
   AddExtent(18, 1, &new_extents);
   AddExtent(21, 2, &new_extents);
   AddExtent(20, 1, &new_extents);
   AddExtent(24, 3, &new_extents);
+  AddExtent(29, 1, &new_extents);
   fake_file_extents[new_path()] = &new_extents;
 
-  // The size of the data should match the total number of blocks.
-  const size_t file_len = 5 * 4096;
+  // The size of the data should match the total number of blocks; the last
+  // block is only partly filled.
+  size_t file_len = 7 * 4096 + 3333;
   const string random_string(reinterpret_cast<const char*>(kRandomString),
                              sizeof(kRandomString));
   string random_data;
@@ -187,10 +191,13 @@
   e.set_start_block(23);
   e.set_num_blocks(1);
   old_extents.insert(old_extents.begin() + 1, e);
+  old_extents[2].set_num_blocks(1);
   new_extents.erase(new_extents.begin() + 1);
   new_extents[2].set_start_block(26);
   new_extents[2].set_num_blocks(1);
-  num_extents -= 4;
+  new_extents.erase(new_extents.begin() + 3);
+  num_extents -= 5;
+  file_len -= 4 * 4096 + 3333;
 
   EXPECT_TRUE(data.empty());
 
