Vassiliki Thanou, Greece's top supreme court judge, was sworn in Thursday as a caretaker head of the government, becoming the country's first female prime minister.
Thanou and her Cabinet will run the troubled country at least until early elections are held September 20.
"The caretaker government's duties are mainly holding the elections in a fair and smooth fashion," she said at the handover ceremony. "Given the circumstances, however, I believe this government will be called upon to tackle critical issues such as the immigration issue."
Along with trying to pull itself out of a long-running economic crisis, Greece is dealing with tens of thousands of illegal migrants arriving on its shores, mainly from Syria, Afghanistan and Iraq, to escape war and terrorism.
As chief judge, Thanou opposed the cuts in spending and government benefits and other austerity measures Greece must carry out as part of another economic bailout by the European Union.
Leftist Alexis Tsipras resigned as prime minister last week following an uprising in his Syriza party over the tough terms of the loan. Under the constitution, opposition parties were given the opportunity to form a new government, but failed.
Tsipras remains popular in Greece. Syriza is forecast to emerge again as the top vote-getter in next month's election, but party leader Tsipras may not have enough votes to form a new government.
He told Greek television this week that he would refuse to cooperate with conservative parties that led previous governments. Opposition leaders accuse Tsipras of blackmailing the country, saying citizens should either vote for him or face more political deadlock.