West Ham United nearly completed an incredible comeback, but were defeated 4-2 on penalties by Leeds United.