Although the history of baklava is not well documented, there is evidence that its current form was developed in the imperial kitchens of the Topkapı Palace in Istanbul. The Sultan presented trays of baklava to the Janissaries every 15th of the month of Ramadan in a ceremonial procession called the Baklava Alayı.
The oldest (2nd century BCE) recipe that resembles a similar dessert is the honey covered baked layered-dough dessert placenta of Roman times, which Patrick Faas identifies as the origin of baklava: "The Greeks and the Turks still argue over which dishes were originally Greek and which Turkish. Baklava, for example, is claimed by both countries. Greek and Turkish cuisine both built upon the cookery of the Byzantine Empire, which was a continuation of the cooking of the Roman Empire. Roman cuisine had borrowed a great deal from the ancient Greeks, but placenta (and hence baklava) had a Latin, not a Greek, origin—please note that the conservative, anti-Greek Cato left us this recipe."
Shape the placenta as follows: place a single row of tracta along the whole length of the base dough. This is then covered with the mixture [cheese and honey] from the mortar. Place another row of tracta on top and go on doing so until all the cheese and honey have been used up. Finish with a layer of tracta. … place the placenta in the oven and put a preheated lid on top of it … When ready, honey is poured over the placenta.Some sources state that this Roman dessert continued to evolve during the Byzantine (Eastern Roman) Empire into modern baklava. In Greek the word plakous (Greek: πλακοῦς) was used for Latin placenta, and the American scholar Speros Vryonis describes one type of plakous, koptoplakous (Byzantine Greek: κοπτοπλακοῦς), as a "Byzantine favorite" and "the same as the Turkish baklava", as do other writers.
Muhammad bin Hasan al-Baghdadi was a compiler from the Abbasid period who described lauzinaq, a dessert similar to baklava in his cookbook Kitab Al-Tabikh. Lauzinaq refers to small pieces of almond paste wrapped in very thin pastry and drenched in syrup. Written in 1226 (in today's Iraq), it was based on a collection of 9th century Persian-inspired recipes. According to Gil Marks, Middle Eastern pastry makers developed the process of layering the ingredients; he asserts that "some scholars said they were influenced by Mongols or Turks". The only original manuscript of Al-Baghdadi's book survives at the Süleymaniye Library in Istanbul (Turkey) and according to Charles Perry, "for centuries, it had been the favorite cookbook of the Turks". A further 260 recipes had been added to the original by Turkish compilers at an unknown date retitling it as Kitâbü’l-Vasfi’l-Et‘ime el-Mu‘tâde, and two of its known three copies can be found now at the Topkapı Palace Library in Istanbul. Eventually, Muhammad ibn Mahmud al-Shirwani, the physician of the Ottoman Sultan Murad II prepared a Turkish translation of the book, adding around 70 contemporary recipes.
Another recipe for a similar dessert is güllaç, a dessert found in the Turkish cuisine and considered by some as the origin of baklava. It consists of layers of phyllo dough that are put one by one in warmed up milk with sugar. It is served with walnut and fresh pomegranate and generally eaten during Ramadan. The first known documentation of güllaç is attested in a food and health manual, written in 1330 that documents Mongol foods called Yinshan Zhengyao (飮膳正要, Important Principles of Food and Drink), written by Hu Sihui, an ethnic Mongol court dietitian of the Yuan dynasty. Uzbek cuisine has pakhlava, puskal or yupka or in Tatar yoka, which are sweet and salty savories (boreks) prepared with 10–12 layers of dough.
There are also some similarities between baklava and the Ancient Greek desserts gastris (γάστρις), kopte sesamis (κοπτὴ σησαμίς), and kopton (κοπτόν) found in book XIV of the Deipnosophistae. However, the recipe there is for a filling of nuts and honey, with a top and bottom layer of honey and ground sesame similar to modern pasteli or halva, and no dough, certainly not a flaky dough.