In a horse-trading deal that could now pave the way for discussions over who will lead the country, a member of the anti-establishment Five Star Movement (M5S), Roberto Fico, was elected speaker of the lower house, the Chamber of Deputies.
In return, Elisabetta Alberti Casellati, a member of the Forza Italia that forms part of the right-wing coalition — and a close friend of former prime minister Silvio Berlusconi — was voted head of the upper house, the Senate.
The deal follows a period of tense negotiations and allows the sides to now start competing to form a government.
M5S heavyweight Fico, 43, was elected with 422 votes out of 620 and Alberti Casellati, 71, becomes the first female Senate president with 240 votes out of 319.
Alberti Casellati was nominated just before the vote on Saturday morning, following a stalemate in a second round of voting on Friday and a reconciliation meeting between rightwing coalition leaders who had clashed over the issue.
Saturday's breakthrough means the rightwing coalition, which won 37 percent of the vote in the March 4 elections, has the Senate speaker, while M5S takes the position for the lower house.
The agreement is crucial because now consultations between Italian President Sergio Mattarella and those competing to form a new government can begin.
Both Luigi Di Maio's M5S and the right-wing alliance, led by Matteo Salvini, are hoping for a chance to lead Italy.
There was an impasse earlier this week after M5S said it could not vote for the rightwing coalition's choice for Senate speaker, former economy minister in Silvio Berlusconi's last government Paolo Romani, due to his 2014 conviction for embezzlement.
Saturday's agreement also follows a strained few days within the rightwing coalition as cracks widened.
Salvini, the leader of the League which heads the rightwing alliance, enraged former prime minister Berlusconi by backing a candidate without consulting the veteran.
Berlusconi, currently banned from public office, branded Salvini's support for Anna Maria Bernini an “act of hostility” designed to fracture the coalition and push the League closer to M5S.
M5S and the right both say they are ready to work with any party that would be willing to adopt their programme, although the centre-left Democratic Party (PD), whose coalition came third with 23 percent, has refused to form an alliance with either of the two top groups.