Members of Italy’s anti-establishment Five Star Movement (M5S) have overwhelmingly backed a coalition with the centre-left Democratic party (PD) in an online vote, giving the final backing to a deal between traditional foes intended to pull Italy out of a political crisis.

The prime minister, Giuseppe Conte, had been tasked with securing a pact between the two parties after Matteo Salvini, the leader of the far-right League, collapsed its coalition with M5S in an attempt to force snap elections in which he hoped to capitalise on his recent popularity.

M5S, which largely built itself online, required its members to endorse the coalition through a vote on the party’s Rousseau website.

The M5S leader, Luigi Di Maio, said he believed the political crisis was now over.

Of the 100,000 M5S members, 79.3% of those signed up to the website answered yes to governing with the PD. Conte delivered a speech to M5S members on Monday in which he tried to convince them to vote in favour, telling them: “I understand your concerns. But I’d also like to remind you that, before the elections, last year the M5S said they were ready to join any political force that was ready to carry out the movement’s political agenda. Today, we have a great chance to change this country.”

The parties on Tuesday published a 26-point programme that would underpin the planned government. At the top of the list was a commitment to use the forthcoming budget to help stimulate economic growth, but also a promise that it would not endanger public finances.

Italy has the second-largest debt burden in the EU as a proportion of economic output, and the pact called for greater flexibility from Brussels to overcome the “excessive rigidity” of existing budget rules.

Emphasising social justice, the two parties pledged to introduce a minimum salary, avoid a planned VAT sales rise and boost spending on education, research and welfare. The programme also called for a web tax on multinationals and the creation of a public bank to help boost development in the south.

Some M5S figures had criticised the decision to put the coalition plan to an online vote and risk a rejection.

“The voting on the platform is not, in this delicate moment, the most appropriate tool, given the timing,” the MP Michele Nitti wrote on Facebook. “I am surprised the decision to do so was taken, despite the concerns that emerged after the last meeting with the colleagues of the movement.”

In a statement to the Italian news agency Adnkronos a few days ago, another M5S MP, Flora Frate, asked Di Maio to withdraw the vote on Rousseau because “binding Mr Conte via the result of a vote on a platform run by a private company, without any guarantee of transparency, is absurd”.

Massimiliano Panarari, a politics professor at Luiss University in Rome, said: “The vote on Rousseau is part of the M5S tradition and was presented as an example of direct democracy, even though it is far from it.

“Submitting the agreement between PD and M5S to the vote seems an affront to the institutions and to the same democratic representation, after President Mattarella formally commissioned Conte to find an agreement to form a new government.”

Web-based direct democracy has been one of M5S’s core principles since it was founded in 2009 by the comedian Beppe Grillo and Gianroberto Casaleggio, an entrepreneur who died three years ago.

In its early years, the movement used its website and Grillo’s blog to debate and hold votes before Rousseau, a purpose-built platform named after the 18th-century Swiss-born philosopher, was developed and introduced in 2016.

But the system has been plagued by hacking attacks during key votes, and in April Italy’s data protection authority fined the company that runs the platform €50,000 (£45,000) for failing to protect users’ personal details.

M5S has held dozens of online votes on key decisions, including one to elect Di Maio and another on whether to enter its previous coalition with the League. The most recent online ballot was on whether to vote in parliament to defend Salvini from prosecution for preventing migrants disembarking from an Italian coastguard ship.

Italy was plunged into chaos last month when Salvini withdrew the League from its fractious alliance with M5S, as he sought to exploit his party’s popularity to bring about snap elections and become prime minister.

The tactics of the League leader, Matteo Salvini, have dented his popularity in recent weeks. Photograph: Stefano Cavicchi/LaPresse via Zuma Press/Rex/Shutterstock

The dramatic move threatened to create a fully formed far-right government. But Salvini, whose tactics have dented his popularity in recent weeks, had not banked on M5S teaming up with the PD. Though the two parties are longstanding enemies, they are also the two largest parties in parliament.

Despite toppling the government, the League remains the most popular party. A poll published on Saturday by Corriere della Sera showed support for the League had fallen to 31.8%, from a mid-July record high of 35.9%. M5S rose almost seven percentage points from mid-July to 24.2%, according to the same poll, while the PD rose marginally to 22.3%.

The future of the new coalition remains uncertain. “It is a government that is surely favoured by Brussels,” said Panarari, “but in order to carry out the programme it will need to govern until 2022. So far, this seems very difficult.”

Conte is expected to draw up a list of ministers by Friday. By this time next week, the new government could already be settled in Rome, with Salvini forced to watch from the opposition benches.