Greece's embattled prime minister and main opposition leader agreed Sunday to form an interim government to ensure the country's new European debt deal and oversee early elections, capping a week of political turmoil that saw Greece facing a catastrophic default and threatening its euro membership.