diff --git src/wp-includes/theme.php src/wp-includes/theme.php
index cf1bb0f..8aac86c 100644
--- src/wp-includes/theme.php
+++ src/wp-includes/theme.php
@@ -1786,9 +1786,14 @@ function wp_update_custom_css_post( $css, $args = array() ) {
 		$r = wp_update_post( wp_slash( $post_data ), true );
 	} else {
 		$r = wp_insert_post( wp_slash( $post_data ), true );
+
+		// Trigger creation of a revision. This should be removed once #30854 is resolved.
+		if ( ! is_wp_error( $r ) && 0 === count( wp_get_post_revisions( $r ) ) ) {
+			wp_save_post_revision( $r );
+		}
 	}
 
-	if ( $r instanceof WP_Error ) {
+	if ( is_wp_error( $r ) ) {
 		return $r;
 	}
 	return get_post( $r );
diff --git tests/phpunit/tests/customize/custom-css-setting.php tests/phpunit/tests/customize/custom-css-setting.php
index e787094..102d303 100644
--- tests/phpunit/tests/customize/custom-css-setting.php
+++ tests/phpunit/tests/customize/custom-css-setting.php
@@ -193,6 +193,34 @@ class Test_WP_Customize_Custom_CSS_Setting extends WP_UnitTestCase {
 	}
 
 	/**
+	 * Test revision saving on initial save of Custom CSS.
+	 *
+	 * @ticket 39032
+	 */
+	function test_custom_css_revision_saved() {
+		$inserted_css = 'body { background: black; }';
+		$updated_css = 'body { background: red; }';
+
+		$post = wp_update_custom_css_post( $inserted_css, array(
+			'stylesheet' => 'testtheme',
+		) );
+
+		$this->assertSame( $inserted_css, $post->post_content );
+		$revisions = array_values( wp_get_post_revisions( $post ) );
+		$this->assertCount( 1, $revisions );
+		$this->assertSame( $inserted_css, $revisions[0]->post_content );
+
+		wp_update_custom_css_post( $updated_css, array(
+			'stylesheet' => 'testtheme',
+		) );
+
+		$revisions = array_values( wp_get_post_revisions( $post ) );
+		$this->assertCount( 2, $revisions );
+		$this->assertSame( $updated_css, $revisions[0]->post_content );
+		$this->assertSame( $inserted_css, $revisions[1]->post_content );
+	}
+
+	/**
 	 * Test crud methods on WP_Customize_Custom_CSS_Setting.
 	 *
 	 * @covers WP_Customize_Custom_CSS_Setting::value()
