功败垂成

gōng bài chuí chéng

to fail within sight of success (idiom); last-minute failure

to fall at the last hurdle; snatching defeat from the jaws of victory

gōng

meritorious deed or service

bài

to defeat

chuí

to hang (down)

chéng

short name for Chengdu 成都[Cheng2 du1]