In 1821, the Greeks declared war on the Sultan. A rebellion that originated in Moldavia as a diversion was followed by the main revolution in the Peloponnese, which, along with the northern part of the Gulf of Corinth, became the first part of the Ottoman Empire to achieve independence (in 1829).