Scottish Labour and the SNP have formed a coalition to run the City of Edinburgh council, it has emerged.
The council had been run by the Liberal Democrats, together with the SNP. But last week's elections saw the Lib Dem support collapse in the capital, leaving them with just three councillors.
Labour is now the largest group on the authority, with 20 councillors, ahead of the SNP's 18, 11 Tories and six Greens.
There had been speculation that Labour would turn to the Liberal Democrats and the Greens to form a coalition but the two biggest parties in the country will now run the council.
Monday evening's agreement follows concerted efforts to reach an all-party alliance following last week's local authority elections. The coalition partners said they hoped to continue to work with the other groups in the interests of the people of Edinburgh.
Andrew Burns, Labour group leader, said: "After listening to the will of the electorate and after intense negotiations over the last few days I am delighted that we have managed to reach an agreement to lead the city of Edinburgh for the next five years.
"Edinburgh electors gave a very clear mandate to Labour and the SNP, delivering 38 out of 58 councillors. A Labour-SNP coalition will now provide the stability and certainty needed to move Edinburgh forward."
Steve Cardownie, SNP group leader, said: "The SNP looks forward to working in partnership with the Labour group with a progressive and exciting agenda to meet the challenges the city faces. With this strong partnership we are best placed to ensure Edinburgh serves its citizens well and emerges from the recession quickly and strongly.
"Our groups' economic policies are almost one and the same and we are confident they will deliver for the people of the city."
Council chief executive Sue Bruce said: "I look forward to working with the new administration, and indeed all councillors, over the next five years.
"A successful council needs a partnership between the elected members who set the direction and policies, and the officers charged with putting that into practice. Together, our responsibility is to ensure that we take Edinburgh forward and make a real difference to the people who live and work here."
Following the coalition agreement, it was announced that Labour will nominate candidates for the positions of council leader and Lord Provost while the Nationalists will nominate candidates for the positions of deputy Leader and deputy Lord Provost.
The first meeting of the new Council is on Thursday May 17, at which it will appoint a new Lord Provost.