Khamsa was written by Persian poet Nizami Ganjavi (c. 1141-1209 CE).