In 1873, the cities of Buda and Pest were merged to form Budapest, the capital of Hungary. The unification also included Óbuda and Margaret Island, after a law passed in 1872 set the process in motion.