Denmark’s new centre-left government will increase public spending and cut greenhouse gas emissions by 70% before 2030, the country’s youngest ever prime minister is to announce.

Social Democrats leader, Mette Frederiksen, 41, said late on Tuesday night that after three weeks of negotiations, she had reached agreement with three leftist parties to form the one-party minority government, a common arrangement in Denmark.

But reports suggest she had to give ground on several of her party’s controversial hardline immigration measures to reach the agreement with her leftwing partners and form the third centre-left government in the Nordic region this year.

“It is with great pleasure I can announce we have a majority to form a new government,” said Frederiksen. “Now we have reached the goal ... we have shown that when Danes vote as they have done, a new majority can turn their hopes into actions.”

As expected, the opposition Social Democrats, despite a slight fall in support to 25.9%, won Denmark’s general election on 5 June, putting theparty in pole position to succeed the minority centre-right government of Lars Løkke Rasmussen.

However, negotiations aimed at securing the parliamentary backing of the three other parties in the traditional leftist “red bloc” – the Social Liberals (Radikale Venstre), Socialist People’s party and Red Green Alliance – took 20 days, the longest negotiation period since 1988.

The parties particularly disagreed on immigration, where the Social Democrats’ support for hardline policies that were long the preserve of the far-right nationalist Danish People’s party (DPP) proved a major obstacle.

Arguing they were needed to protect Denmark’s prized welfare system, Frederiksen backed many of the Rasmussen government’s tough immigration measures.

These included a ban on wearing the burqa and niqab in public and a widely criticised – if largely symbolic – “jewellery bill” that in principle allows police to seize refugees’ valuables to help pay costs.

Last year, Frederiksen’s party proposed sending asylum seekers to special reception centres outside Europe while their requests were being processed, and suggested a cap on the number of “non-western” immigrants allowed into the country.

In a series of concessions to her leftwing partners, however, Fredriksen has reportedly agreed that Denmark will drop plans to accommodate rejected asylum-seekers on Lindholm, an uninhabited island, and resume accepting refugees under the UN’s quota system, which it has not done since 2016.

Frederiksen will present the 18-page government agreement, which also includes pledges to reverse years of spending cuts in education and healthcare, later on Wednesday, with the new government expected to be unveiled on Thursday.

The incoming prime minister described the accord as “one of the first in the world to really define green ambitions”. Environmental groups welcomed the commitment to a 70% cut in emissions by 2030 when it was first announced last week.

“This is extremely ambitious, I’m very excited,” Maria Reumert Gjerding of the Danish Society for Nature Conservation told local media. “It will make Denmark one of the most ambitious countries in the world on climate and if you’d asked a year ago whether we’d be here now, I’d have said ‘no’.”

Mads Flarup Christensen of Greenpeace Nordic said the target would take “a historic effort” but “if a Social Democrat-led government can get this done it would be a huge win, both for the climate and for Danish voters.”

Frederiksen, a fourth-generation Social Democrat, made her debut in parliament at 24, serving as employment minister and justice minister before taking over the country’s largest political party from Helle Thorning-Schmidt, the country’s first female prime minister.

“She has been preoccupied with political matters since she was six or seven years old,” Frederiksen’s father, Flemming, a retired typographer and longstanding Social Democrat campaigner, told the Danish news agency Ritzau before the election. She joined the Social Democrats’ youth league at 15.

The party’s victory is the third for the Nordic centre-left in the past year: Finland’s Social Democrats narrowly won elections in April on a promise to raise taxes to increase social spending levels, while Sweden’s centre-left party held on to power last year by pledging welfare reforms.

However, analysts doubt the Danish Social Democrats’ hardline approach to immigration would necessarily work for other once mighty social democratic parties in Europe, currently searching for a way forward after struggling in recent elections – and in some countries, such as France, being all but annihilated.

It is unclear whether the Danish Social Democrats’ attempts to win back working-class votes lost to the far right over immigration was effective: while the DPP shed more than half its support, its former voters opted more for Rasmussen’s Liberals than for the centre-left party.

While the Social Democrats’ vote share declined compared with the previous 2015 elections, the Liberals’ increased. Moreover, support for parties further to the left, all of which opposed Frederiksen’s stance on immigration, grew strongly – which is what, ultimately, allowed her to form a government.

The Social Democrats’ hardline on immigration may, therefore, have moved politics to the left in Denmark: although it lost more votes to the left than it won from the DPP, the net transfer allowed a leftist minority government to oust the centre-right.

But many political scientists, in Denmark and abroad, believe it is far from sure the same tactic could be replicated in other European countries, where voters have turned their back on the centre-left mainly for economic reasons.