功败垂成

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]