Political career
In the 1998 election, Halsema was a candidate on the list of GroenLinks after being courted by Paul Rosenmöller. She was the third candidate on the list, making her the highest new candidate and practically guaranteed her a seat in the House. The seventh was her former De Balie-colleague Vendrik. GroenLinks more than doubled its seat total from five to eleven. In her first period in the House, Halsema was spokesperson justice, asylum seekers and home affairs. She became well known due to her opposition to the tougher migration law proposed by Job Cohen.
In the 2002 election, she was given the second place on the list. The party lost one seat. Halsema became vice-chair of the parliamentary party and among others spoke for the party in the first debate with the First Balkenende cabinet. In November of that year Paul Rosenmöller unexpectedly announced that he would leave politics. He asked Halsema to succeed him, and she immediately agreed. Ten days before the party congress she was announced as the only candidate for the party leadership and became top candidate for the 2003 election. The party lost another two seats. In addition to the party leadership she was spokesperson on areas of culture and media, healthcare, spatial planning and the environment. As party leader she had a more prominent position and put forth a number of private member's bills, including one concerning judicial review and another that sets a fixed price for books (together with the leader of the Democrats 66 (D66) Boris Dittrich).
Between October 2003 and January 2004, Halsema was on maternity leave. She got twins. Marijke Vos, the vice-chair of the parliamentary party took over as party leader. After her return to the House of Representatives, Halsema started a debate about the course of the left in general and GroenLinks in particular. She claimed that her party was the last "left liberal party in the Netherlands". She called for increased cooperation with the Socialist Party, the Labour Party and GroenLinks, aiming at a left-wing majority government after the 2007 election. She asked Labour Party leader Wouter Bos to speak out in favour of such a cabinet, but he refused in order to allow for a possible coalition of the Labour Party and the Christian Democratic Appeal. In January 2006, she was elected "Liberal of the Year" by the Youth Organisation Freedom and Democracy, the youth organisation of the People's Party for Freedom and Democracy (VVD), because of her new political course, in particular where it came to reforming the welfare state. In June 2006, she was the only candidate for the top spot on her party's list. During the campaign, she published Linkse lente (Left-wing Spring), a book co-authored by Michiel Zonneveld, which blends her political vision and personal biography. In the 2006 election the party lost another seat.
In 2007, she took over the private member's bill of Wijnand Duyvendak, who worked together with Niesco Dubbelboer of the Labour Party and Boris van der Ham of D66, to allow for a non-binding corrective referendum. In April 2010 the party congress voted against including the referendum in the party manifesto.
In the run-up to the 2010 elections, she was given the Thorbecke prize for political eloquence. and she was elected by Intermediair as the best candidate for Prime Minister.
During the 2010 election, GroenLinks went from seven to ten seats. The party, under Halsema, negotiated with the VVD, the Labour Party and D66 to reach agreement on a new "Purple Plus"-government, but the negotiations failed.
On 17 December 2010, Halsema announced that she would leave parliament and that Jolande Sap was elected as the new leader of GroenLinks. She formally left parliament in January 2011.
In 2016, she made public in her political memoire Pluche (Plush) that after the 2012 election she was asked to consider becoming minister of Development Cooperation by Lodewijk Asscher, the Labour Party leader, but the VVD vetoed this.
On 27 June 2018, Halsema was appointed Mayor of Amsterdam, beginning a six-year term on 12 July 2018. She is the first woman to hold the position on a full basis; Guusje ter Horst and Kajsa Ollongren had previously served only in an acting capacity (for 14 days in 2001 and 21 days in 2017, respectively). Halsema is also the first member of GreenLeft to become mayor of Amsterdam. In 2024, Halsema was officially reappointed for a second 6-year term.
Protests related to the murder of George Floyd took place on Dam Square in Amsterdam on 1 June 2020. Halsema faced criticism over the large turnout and the difficulty of enforcing the 1.5-meter social distancing rule introduced during the COVID-19 pandemic. Critics, including members of the medical community, argued that insufficient action had been taken to manage the crowd and ensure public health measures were observed. Similar protests were held in Den Haag and Rotterdam, where distancing measures were more strictly enforced. In Rotterdam, a subsequent protest was stopped due to overcrowding, and other demonstrations were cancelled.
On 1 July 2021, Halsema apologised for the city's involvement in the Atlantic slave trade.
In November 2024, Halsema expressed regret over her prior labeling of the November 2024 Amsterdam riots as a "pogrom". Halsema said that the term pogrom is being used as propaganda by Dutch politicians to discriminate against Moroccans and Muslims. Israeli Foreign Minister Gideon Sa'ar criticised Halsema, saying that her comment was "utterly unacceptable".