Who wrote the Book of Esther in the Bible?

The authorship of the book of Esther is a subject of debate. According to Rashi on Chapter 9, verse 20 of the book, Mordecai was the author. However, the Talmud in Baba Batra 15a ascribes the book to the Anshei Knesset HaGedola (the men of the great assembly).

Answer

The Book of Esther purports to explain how Esther became queen of Persia during the fifth century BCE, and how the Jews were saved from a massacre, but it is not viewed by scholars as historically true. Views as to when the book was written vary from the late fourth century, down to the second century BCE. We do not know who the anonymous author was.

Answer

While the book does not specify an author, the two leading candidates for authorship are Ezra and Mordecai.

Answer:
Rashi commentary (on Esther 9:20) ascribes the Scroll of Esther to Mordecai. Rashi, who is invariably loyal to the words of the Talmud-sages, is not debating the Talmud which ascribes Esther to the Men of the Great Assembly. Rather, he is clarifying that the Assembly didn't create this Scroll from scratch; they merely edited and canonized what Mordecai had already written.