diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
index 3634190663..fbd6614581 100644
--- a/src/wp-includes/functions.php
+++ b/src/wp-includes/functions.php
@@ -2097,6 +2097,18 @@ function wp_mkdir_p( $target ) {
 		return true;
 	}
 
+	/*
+	 * If we get here, mkdir() failed.
+	 *
+	 * Maybe another process was trying to create the directory at the same time
+	 * (and succeeded)?
+	 *
+	 * Check if the target exists (again).
+	 */
+	if ( file_exists( $target ) ) {
+		return @is_dir( $target );
+	}
+
 	return false;
 }
 
