ROME — After more than two months of political deadlock, Italian populist parties announced on Friday that they had agreed on a common platform for governing that would allow them to push ahead with a potentially budget-breaking and anti-immigration agenda that seeks to adjust Italy’s relationship with Europe.

The document diluted some of the most antagonistic policies toward the European Union that were leaked in an earlier draft agreement and rattled Italy’s financial markets this week.

But it nonetheless preserved the core of the populist promises that won the anti-establishment Five Star Movement and the hard-right League party 50 percent of the vote in inconclusive March elections.

Both parties said they will now put the document before their bases for approval. But the most important vote will be that of President Sergio Mattarella, who has the authority to block the formation of the government if he believes it is unconstitutional.