in sense 1 with varying stress & intonation, in sense 2 with heavy or emphatic stress on each syllable interjection
Etymology: Middle English
1. — used conventionally as a concluding utterance on parting at night
2. — used especially to express surprise