Athens, Greece (CNN) -- Greece will hold new elections on June 17, state media reported Wednesday, amid a political and economic crisis that could have effects far beyond the country's borders.
News of the election date came as Greeks pulled hundreds of millions of euros out of the banking system amid fears that the country will not be able to stay in the European Union's single currency.
Just 10 days ago, Greeks voters punished the major parties for harsh budget cuts, leaving no party able to form a government.
A caretaker administration led by a senior judge will run the country until the new vote.
Interim Prime Minister Panagiotis Pikrammenos was sworn in Wednesday. The president's office said Cabinet ministers will take their oaths of office Thursday morning.
The political deadlock is leading to fears that Greece will not have a government in place when it needs to make critical debt payments, which could in turn jeopardize its place in the eurozone, the group of 17 European Union countries that use the euro currency.
And a Greek crisis could spread, one analyst warned.
"If Greece exits the euro it won't be alone. Others will exit," said Paul Donovan, a global economist with UBS bank.
"There would be bank runs across multiple countries," he predicted. "Citigroup, for example, may not be exposed to Greece, but it may be exposed to Portugal, Spain, France. ... It may be exposed to a company that's exposed to France, or exposed to exports to EU."
In a worst-case scenario, he said, "you're talking about widespread defaults in the corporate sector as well as the sovereign sector. It becomes very problematic."
Even so, most major European stock markets ended the day Wednesday virtually unchanged.
European leaders were united Wednesday in saying they want to help Greece stay in the euro.
As Greek politicians met Wednesday to set the new election date, German Chancellor Angela Merkel said she regrets the suffering of the Greek people in the face of harsh government budget cuts.
"It's very bitter, obviously," she said of the austerity measures that have left some Greeks struggling to pay for food or utilities.
But, she said, "Sacrifices had to be made. ... I think these are necessary measures that had to be taken."
Merkel, a champion of forcing governments to balance their budgets in order to promote stable economic growth in Europe, did offer possible assistance to Greece.
"Europe needs to show solidarity and help, particularly with growth, unemployment and development," she said.
The head of the European Union's executive body, the European Commission, said Wednesday that Greece is "part of our family," and that the EU will do what it can to keep Greece in the euro and the union.
But the final decision has to come from the Greek people, Jose Manuel Barroso said.
"We are fully aware that the present situation is asking a lot of the Greek people, with many sacrifices. But this is a result of policies made in the past," he said.
"The program for Greece is the least difficult of all the difficult alternatives. The problems it addresses are real," he warned.
Merkel and Barroso spoke after Greeks withdrew hundreds of millions of euros from banks, prompting the president of Greece's central bank to warn that panic is possible, but is not taking place.
Greeks pulled about 800 million euros out of the banking system Monday, President Karolos Papoulias said.
He said he had spoken to Central Bank Governor George Provopoulos about it.
"There is, of course, no panic, but there is fear that could develop into panic," Papoulias said, describing what the bank governor told him. "He also said that the strength of banks is very weak at the moment."
The Greek debt crisis threatens the stability of the European Union's single currency.
Europe is worried that Greece could fail to make debt payments as early as next month, which could force the country out of the euro.
Merkel said she is working to keep Greece in the eurozone, but she refused to be drawn into talk about what would happen if Greece did not meet its debt obligations.
The head of the European Central Bank echoed Merkel's remarks.
"I want to state that our strong preference is that Greece will continue to stay in the euro area," Mario Draghi said in a speech in Frankfurt on Wednesday.
The European Central Bank and International Monetary Fund have been pumping money into Greece to keep the country in the euro, but they have demanded that the Greek government slash spending to get the funds.
Radical leftist leader Alexis Tsipras, whose Syriza party reaped the benefits of voter frustration with the austerity measures, urged Greeks on Tuesday to continue resisting "the parties of the bailout."
"They asked us to leave the country without any hope," he said, arguing that the May 6 election had made the terms of the bailout "null and void."
New Democracy leader Antonis Samaras, meanwhile, said his party will "keep fighting for a developing Greece within Europe" and "against those who say they want to get Greece out of Europe."
His party narrowly came in first in the May 6 elections, but opinion polls since then have suggested that Syriza would finish in first place in a new election.
Matthew Chance reported from Berlin, and Antonia Mortensen reported from Athens. CNN Business Producer Katy Bryon, CNN's Per Nyberg and journalist Elinda Labropoulou contributed to this report.