1650s, "freely bestowed," from Latin gratuitus "done without pay, spontaneous, voluntary," from gratus "pleasing, agreeable," from gratia "favor" (see grace (n.)). Earlier was gratuital (1590s). Sense of "uncalled for, done without good reason" is first recorded 1690s.