diff --git a/src/wp-includes/blocks/post-featured-image.php b/src/wp-includes/blocks/post-featured-image.php
index 8da66accd3..b0f89f90cd 100644
--- a/src/wp-includes/blocks/post-featured-image.php
+++ b/src/wp-includes/blocks/post-featured-image.php
@@ -60,7 +60,7 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
 		$height         = ! empty( $attributes['height'] ) ? 'style="' . esc_attr( safecss_filter_attr( 'height:' . $attributes['height'] ) ) . '"' : '';
 		$featured_image = sprintf(
 			'<a href="%1$s" target="%2$s" %3$s %4$s>%5$s%6$s</a>',
-			get_the_permalink( $post_ID ),
+			esc_attr( $attributes['rel'] ),
 			esc_attr( $link_target ),
 			$rel,
 			$height,
