A pacifist environmentalist and expert on crime thrillers emerged on Thursday as Iceland’s new prime minister, its fourth in two years, after three parties signed a coalition agreement.

Katrin Jakobsdottir, 41, chairwoman of the Left-Green Movement, will lead the government of the North Atlantic island of 340,000 residents after elections in October that were blighted by scandal and voter mistrust. (The job of president, held by the historian Gudni Johannesson, is considered a largely ceremonial role.)

Ms. Jakobsdottir will govern in coalition with parties of very different creeds: the conservative Independence Party and the centre-right Progressive Party.

“It is important that we try to change the way we work together,” she said on Thursday at a news conference in Reykjavik, the capital, to announce the coalition. “This agreement strikes a new chord.”

Together, the coalition parties hold a slender majority: 35 seats in the 63-seat Parliament, the Althingi. Two Left-Green lawmakers, however, have already refused to commit to the coalition deal, which could strengthen the hand of the five opposition parties.

Among them are the Icelandic Pirate Party, which lost ground in the recent elections. Its maverick crew of hackers, anarchists and futurists proved unable, and unwilling, to find a way to join the governing coalition. Bright Future, a hipsterish coalition party from the previous government, failed to live up to its name, having lost all its seats. A year ago, both parties had been seen as fresh alternatives.

Iceland: The island at the heart of the world Show all 2 1 /2 Iceland: The island at the heart of the world Iceland: The island at the heart of the world Water, water everywhere: The country's capital Reykjavik Iceland: The island at the heart of the world Divers at Silfra Fissure in Thingvellir National Park Alamy

At the news conference, the previous prime minister, Bjarni Benediktsson, struck an upbeat note. “All Icelanders will enjoy the benefits of this agreement, both with regards to social security and general prosperity,” he said.

Mr. Benediktsson, whose Independence Party has featured in nearly every government since Iceland broke away from Danish rule in 1944, joined the new government as finance minister.

Ms. Jakobsdottir, a former education minister, is often cited by opinion polls as being one of the most trusted and well-liked politicians in Iceland, a popularity that far outstrips that of her party. She had campaigned on pledges to restore welfare benefits and to make Iceland carbon neutral by 2040.

Her party also called for the adoption of a new Constitution partly crowdsourced through social media. She, like her party, opposed Iceland’s continued membership in NATO.

Politics in Iceland have been mired in scandal since the financial crisis that began in 2008. But some observers said they hoped that the broad-based coalition could bolster stability in the wake of a resounding economic recovery: A tourism boom has driven unemployment down to almost zero.

“She is the party leader who can best unite voters from the left and right,” said Eva H. Onnudottir, a political scientist at the University of Iceland. “Because this coalition includes parties from the left to the right, their work will be more about managing the system instead of making ‘revolutionary’ changes. This could work quite well as long as the economy is stable and prosperous.”

Ms. Onnudottir said she doubted that the adoption of a social media-driven Constitution would occur under this government. Both the Progressives and the Independence Party have strongly resisted the notion of a new Constitution in the past.

Before getting into politics, Ms. Jakobsdottir wrote her thesis on an Icelandic crime novelist, Arnaldur Indridason, and worked at the national broadcaster, RUV. She hails from a prominent Icelandic family of poets, professors and politicians.

She is Iceland’s second female prime minister, after Johanna Sigurdardottir, who took the post in 2009. Iceland also had the world’s first directly elected female president, Vigdis Finnbogadottir, who served from 1980 to 1996.

Ms. Jakobsdottir also stressed on Thursday the importance of gender equality, vowed further steps to counter climate change and expressed a willingness to have Iceland take in more refugees.