The story
Literally, to release one's spirit or soul from the body at death. From Middle English "gaf up þe gost", "ȝave up þe gost", from Old English phrases as "hēo āġeaf hire gāst" (literally, "she gave up her ghost [spirit]"), "þæt iċ gāst mīnne āġifan mōte" (literally, "that I must give up my ghost [spirit]"). Compare German den Geist aufgeben, Dutch de geest geven, French rendre l'âme. Perhaps most notable and survived in modern English for being used in traditional translation during the death of Jesus during His crucifixion
Etymology from Wiktionary, CC BY-SA 4.0.