The phrase comes from classical funerary writing —
呜呼 (wūhū) is a sigh,
哀哉 (āizāi) literally 'how sad!'. Together they're the conventional sign-off of formal eulogies (
祭文) since the Han dynasty. In 《
诗经·
大雅·
召旻》 already: '
於乎哀哉.' Modern speakers borrow it half-jokingly to mean 'and that was the end of that.'