In St.Matthias Catholic Church, Szentháromság tér 2., in Buda Castle. You can't miss it. Photo from TripAdvisor
Opening hours: Mon - Fri: 09:00-17:00, Sat: 09:00 – 13:00, Sun: 13:00 – 17:00
The first church built on this site was the Church of Our Lady (Nagyboldogasszony templom), founded in 1038 by St. Stephen, the first king of Hungary. He "declared the Virgin Queen and Patroness of Hungary, the first monarch so to dedicate his country."(*1) That church was destroyed by the Mongols in 1241. St. Matthias' church was founded by King Béla IV after the Mongol invaders left Hungary in 1242.
The Black Madonna is a copy of the Loreto Madonna. In 1541 the Turks occupied Buda and turned the Church of Our Lady into a mosque.The faithful credit the Black Madonna with the miraculous recapture of Budapest by the united Christian army in 1686. According to legend, when the Turks put Buda castle under siege, people walled in the statue inside its niche so the invaders wouldn’t find it. During the recapture in 1686 an explosion demolished the walls around the statue revealing the Virgin’s shining face. The Turks took this as a bad omen and gave up this part of the castle without a fight.(*2)
Not much remained of the original building due to numerous expansions, wars and reconstructions.
*1: Ean Begg, The Cult of the Black Virgin, Arkana Books, 1985, p. 240