Mayor of Budapest
In June 2019, in the opposition's first primary election, he was elected as the opposition (MSZP-P-DK-Momentum-LMP-MLP)'s candidate. While Jobbik did not endorse Karácsony outright, the party opted not to run a candidate against him. This left Karácsony as the sole opposition candidate for the position of Lord Mayor of Budapest in the 2019 local elections, against incumbent Lord Mayor István Tarlós, who was supported by the ruling coalition, Fidesz–KDNP. He then went on to win the election on 13 October 2019 with 50.86% of the votes being cast in his favor, with Tarlós receiving 44.10%.
On Karácsony's initiative, the mayors of the capitals of all four Visegrád Group countries signed the Pact of Free Cities in Budapest in December 2019. The pact promotes "common values of freedom, human dignity, democracy, equality, rule of law, social justice, tolerance and cultural diversity".
He gained international popularity in 2021 when he renamed four streets in Budapest to "Free Hong Kong Street", "Uyghur Martyrs Street", "Dalai Lama Street" and "Bishop Xie Shiguang Street" in protest of the Hungarian government's decision to open a branch of China's Fudan University in Budapest. In 2019, the university had formally changed its educational status and philosophy, notably removing the phrase "academic independence and freedom of thought" and including "commitment to follow the leadership of the Communist Party". Fudan's Budapest campus was thus considered by Karácsony and thousands of Hungarian citizens who had protested against the opening of the university as a sign of a pernicious expansion of Chinese influence in Hungary.
Karácsony called Budapest a "republic" and an “island of freedom" during his term. He argued that the Fidesz government had made the equivalent of a declaration of war on the city due to their defeat in the 2019 election. The social values against which the government oriented its policies were present in Budapest, he added. Karácsony emphasized that, in addition to the COVID-19 pandemic and the global energy crisis, the Fidesz government took a lot of powers and financial resources away from Budapest in the 2019–2024 term purely for political reasons, which made the city budget unstable. Thus, the implementation of many municipal projects was delayed or became impossible. During his re-launch campaign, Karácsony argued that Budapest's future would be decided by the city's ability to provide affordable housing in the short and long term. In this regard, he wanted to rely on directly callable EU funds, bypassing the government's distributive role. Karácsony argued that he had demonstrated his ability to cooperate with the Hungarian government after a common tariff system was established with the participation of Hungarian State Railways (MÁV), Volánbusz and Budapesti Közlekedési Zrt. Under Karácsony, the BuBi bicycle-sharing network was also re-organized and expanded. Karácsony established a housing agency that provides municipal housing for the homeless. The reconstruction of Metro Line M3 was completed under his term, but the lack of accessibility and air-conditioning remained an unfulfilled campaign promise. The Széchenyi Chain Bridge and Blaha Lujza tér were also renovated.
On 9 June 2024, Karácsony ran for and won a second term as mayor of Budapest in the 2024 Budapest mayoral election, narrowly beating LMP candidate Dávid Vitézy, who was backed by Fidesz candidate Alexandra Szentkirályi, after she left the race two days before the election due to poor polling performance.
In late May 2025, Karácsony held a press conference in which he claimed that Budapest was on the brink of bankruptcy, and that the Hungarian Government was demanding the capital municipality pay 50 billion forint to pay the "Solidarity Tax", which was a tax paid by wealthier municipalities to distribute money to less wealthy municipalities. This tax has significantly risen since Karácsony became mayor, with him calling this rise in tax a political move by the government. He also asked for legal protection from the courts to avoid the government from taking this unpaid tax money from the municipality’s accounts. The government then deducted 10.2 billion forint from the municipality, which Karácsony deemed illegal, and asked the city-owned public transport company, the Budapesti Közlekedési Központ (BKK), to make a plan to conserve money in case more money was deducted. He also said that all public transport operated by the BKK would completely halt for 10 minutes on the 6th of June between 11:50 AM and 12:00 PM, as a protest against the government's actions against the municipality. Around this time, the CEO of BKK, Walter Katalin, resigned from his office, due to pressure around corruption claims. Then, on 17 June 2025, the courts granted financial protection to the Budapest municipality, and ordered that the Hungarian State Treasury return the 10.2 billion forint taken from the city.
When the Hungarian Pride parade ban was put into law on 18 March 2025, Karácsony was completely against the ban, and claimed that Budapest Pride would still happen that year, and that it "could be bigger than ever." He then travelled to the 2025 Vienna Pride parade, where he made a speech in which he claimed that "if Pride can be banned in an EU member state, then no EU citizen is safe". Karácsony then declared that Budapest Pride would be classified as a municipal event, meaning that the police would not have the authority to ban it, which the police did anyway. The parade took place despite the ban, with around 100,000 people attending. Karácsony attended the parade, with him making a speech near the end of the event. He also got into some controversy when some people accused him of making the Nazi salute whilst making the speech, which was echoed by far-right Anti-Islam Dutch politician Geert Wilders, with him saying that Karácsony made an "antisemitic Nazi gesture". However, this was disproven, as a recording of Karácsony's speech from a different angle showed that he was not doing a Nazi salute, but rather pointing to the Carmelite Monastery of Buda, the official seat of the Prime Minister of Hungary, whilst saying "You (Viktor Orbán) have no power over us." Karácsony responded to Wilders' allegations by saying on X, formerly Twitter, "I'm pointing toward the office of your ideological ally while saying: 'You have no power over us.' 200,000 free Hungarians understood perfectly."
On 1 August 2025, Karácsony was questioned by Hungarian police at the National Investigation Bureau on his involvement in the Budapest Pride parade earlier that year. Karácsony then made a speech after the questioning, saying that he did not answer any of the police’s questions, instead choosing to read out a statement of his legal position, which was that given the event was a municipal event, it did not apply to the law banning events of that nature. He said he found it surreal that someone can be tried for a municipal or local event, whilst “thieves of public funds, embezzlers of 100 billions” are not even being dealt with. On 28 January 2026, prosecutors charged Karácsony for organizing Budapest Pride last year, despite it being banned by assembly law.