diff --git a/src/index.php b/src/index.php
old mode 100644
new mode 100755
diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php
index ef732407de..462fe36678 100644
--- a/src/wp-admin/includes/post.php
+++ b/src/wp-admin/includes/post.php
@@ -429,6 +429,22 @@ function edit_post( $post_data = null ) {
 		}
 	}
 
+	/*
+	 * If this post save is actually a meta box save triggered immediately after an autosave from the block editor,
+	 * we need to update the autosave date to after this save, so that it isn't auto-deleted as being outdated.
+	 */
+	if ( isset( $_GET['meta-box-loader'] ) ) {
+		$autosave = wp_get_post_autosave( $post_id, get_current_user_id() );
+		if ( $autosave ) {
+			/*
+			 * We need to wait for 1 second, to ensure the updated autosave will have a later
+			 * post_modified_gmt than the post updated above.
+			 */
+			sleep( 1 );
+			wp_update_post( $autosave );
+		}
+	}
+
 	return $post_ID;
 }
 
