Spain won 5-2 against the Ivory Coast after extra-time and United defender Bailly was heavily involved at both ends.
Bailly bundled in the opener from a corner but then played in Dani Olmo to equalise and he misjudged a header that was punished by Rafa Mir for Spain's 93rd minute equaliser.
He then conceded the extra-time penalty with an inexplicable handball from a corner that allowed Spain to go 3-2 ahead..
After elimination, Bailly posted online: "Sad for being eliminated. We battled with everything we had. Proud to be a part of this team that shortly will give more joy to our country. We will try again next time."