Backport of #11283
Backport of #11283