Later on, women who worked as prostitutes and courtesans entertained men in the red-light districts of Japan. In 1589, authorized the building of a neighborhood in Kyoto, closed from the outside with walls. It was called , and it was dedicated to pleasure. was established as a red-light district officially in 1640, and became one of three areas in Japan where people could legally practice prostitution; the other two areas were in Tokyo, which had been established in 1617, and in Osaka.