Answer:
The Ottoman ruler that added Baghdad to Ottoman territory was Suleiman the Magnificent.
Explanation:
Suleiman the Magnificent was the Sultan of the Ottoman Empire from 1520 to 1566. He was born in Trabzon on what is now Turkey.
After reaching the throne, he undertook a series of military campaigns, extending Ottoman borders to include the Balkans and part of the Holy Roman Empire. In 1522, he seized the island of Rhodes, and in 1526, he defeated the Hungarian king and killed him at the Battle of Mohacs. He besieged the city of Vienna in 1529 and 1532, but without success, and in 1533 made a peace treaty with Archduke Ferdinand.
In the east, he fought against the rulers of the Persian Safafid Empire. He captured the city of Baghdad in 1534. He also seized much territory in North Africa.