Backported patch for #64370