It apparently goes back further than mankind itself. The New York Times reports the first observed case of monkey prostitution:
Something else happened during that chaotic scene, something that convinced Chen of the monkeys’ true grasp of money. Perhaps the most distinguishing characteristic of money, after all, is its fungibility, the fact that it can be used to buy not just food but anything. During the chaos in the monkey cage, Chen saw something out of the corner of his eye that he would later try to play down but in his heart of hearts he knew to be true. What he witnessed was probably the first observed exchange of money for sex in the history of monkeykind. (Further proof that the monkeys truly understood money: the monkey who was paid for sex immediately traded the token in for a grape.)