In the 16th century the Ottoman Empire had conquered the southern "line of fortresses" (végvár) of the Kingdom of Hungary. After the Battle of Mohács where the Kingdom of Hungary was heavily defeated, and the turmoil caused by the defeat, the influence was spread on the middle part of the Kingdom of Hungary. While Ottoman troops invaded Buda in 1526 and 1529, Suleyman I used the Buda area as a territory of the allied kingdom and did not annex it fully to the Empire.