Originally a compound of 御(o, honorific prefix) + 愛でたく(medetaku, “admirably, auspiciously”), from adjective 愛でたい(medetai, “admirable, auspicious”).
Modern Japanese -i adjectives formerly ended in -ki for the attributive form. This medial /k/ dropped out during the Muromachi period, both for the attributive form (-ki becoming -i) and for the adverbial form (-ku becoming -u). However, the adverbial form reverted back to -ku thereafter for most words, with the -u ending persisting in certain everyday set expressions, such as arigatō, ohayō, or omedetō, and in hyper-formal speech.
Most often written in hiragana. May occasionally be seen spelled in kanji, generally for more formal writing. The kanji spellings are examples of ateji. Usually followed by ございます(gozaimasu, “it is”, formal) in less casual contexts.