The town was founded around 1550 by Kamal Khan, a Mirani Balooch and a descendant of Ghazi Khan who laid foundation of Dera Ghazi Khan. Around 1610, the town was taken from the Mirani Rulers by the Jaskani Balochs, who held it until 1787. Abdun Nabi Sarai was appointed Governor by Timur Shah Durrani, but three years later it was included in the Governorship of Muhammad Khan Sadozai, who transferred his seat of Government to Mankera.
In 1794, Humayun Shah, the rival claimant to the throne of Kabul, was captured near Leiah and brought into the town, where his eyes were put out by order of Zaman Shah. Under the Sikh Government, the town once more became the centre of administration for the neighbouring tract, and after the British occupation in 1849, was for a time the headquarters of a Civil Administrative Division.
This administrative status of Layyah was short-lived and the British reduced it to the level of Tehsil headquarters, making it a part of Dera Ismail Khan.
In 1901, Layyah was transferred to the new District of Mianwali. Later on, it was made part of the Muzzaffargarh District. In 1982, Layyah Tehsil was upgraded to District headquarters comprising three Tehsils: Layyah, Karor Lal Eisan and Chaubara. The municipality was created in 1875. The population, according to the 1998 census was 2 Million. Per capita income during the ten years ending 1902-3 averaged Rs. 9,900, and expenditure Rs. 10,100. In 1903-4, the income was Rs. 10,600, chiefly derived from octroi, and the expenditure was Rs. 10,600.