* Government resigns after a year in power
* Resignation paves way for snap election in October
* Jubilant crowds gather in front of parliament building
* Bank crisis will push up fiscal deficit: analyst (Adds quotes, details, background)
By Tsvetelia Tsolova and Angel Krasimirov
SOFIA, July 23 Bulgaria's Prime Minister Plamen Oresharski stood down on Wednesday, leaving his successor to sort out the Balkan state's worst banking crisis since the 1990s with the fate of its fourth largest lender undecided.
Oresharski, in power for just over a year, had flagged his departure after the ruling Socialists' poor showing in May's European Parliament elections. His resignation paves the way for an interim government to take over in August and a general election in October.
The vote marks the second snap election in less than two years in the European Union's poorest member state. The prolonged instability has hampered efforts to make the economy more efficient and prompted a credit rating downgrade in June.
The Socialist-led coalition increased the minimum wage, worked to cut red tape for businesses and found investors for a 1.5 billion euro ($2 billion) sovereign bond last month despite the banking crisis.
But Oresharski's tenure was overshadowed by months of street protests against corruption, deadly floods that hit the Black Sea city of Varna in June and a standoff between Brussels and Moscow over a Russian-led gas pipeline project.
The Socialists ruled with the ethnic Turkish MRF party in a minority coalition, which relied on the outside support of the nationalist Attack party to cling to power and survive repeated no confidence votes while in office.
Hundreds gathered in the Bulgarian capital as news of the resignation broke, chanting "victory", as two lines of police looked on in front of the parliament building. Wednesday also marked the first anniversary of an eight-hour siege of parliament by protesters demanding the government's resignation.
But opposition GERB leader Boiko Borisov wrote on his Facebook wall: "Such a belated resignation, and knowing what ruin they leave behind, I could not even enjoy it."
Earlier, protesters threw tomatoes at a government building, according to local media reports.
The government stands down with no consensus in sight about how to rescue Corporate Commercial Bank (Corpbank) and protect its depositors after a run on the bank in June.
The central bank governor on Tuesday wrote to parliament offering to step down, saying he would not let the bank be used as a political "toy" after repeated attacks on the institution.
Depositors unnerved by reports of shady deals by Corpbank's main owner withdrew more than a fifth of deposits in a week-long bank run. The owner, who was locked in a public feud with a business rival at the time, has denied any wrongdoing and said the run was a plot hatched by his competitors.
The run prompted the central bank to seize control of Corpbank for three months, block depositors from taking out their money and commission an audit. Panic spread to another lender, forcing the Bulgarian government to free up an emergency credit line for its banking system.
"Although the authorities successfully intervened to prevent contagion, the price of the containment effort will be higher deficit and debt levels," Tsveta Petrova, an analyst at the Eurasia Group, said in a note on Wednesday.
Sofia has estimated the state rescue cost at about 1.5-2 billion levs ($1.4 billion). Bulgarian authorities have pursued various options for rescuing Corpbank, including hiving off its healthy assets and liabilities into a subsidiary, which would then open as a nationalised bank under a new name.
But lawmakers rejected that rescue package, making a resolution unlikely before parliament dissolves in August.
Parliament will now vote on whether to accept Oresharski's resignation, likely on Thursday or Friday. The GERB party, which governed Bulgaria until it was toppled by street protests in February 2013, looks set to win the October polls.
But it might fall short of a majority, prolonging the instability that prompted Standard & Poor's to downgrade Bulgaria's sovereign debt rating to one notch above junk.
GERB has put forward its own proposals for solving the bank crisis, including purging the central bank's leadership and guaranteeing deposits of up to 100,000 euros at Corpbank - short of the government's pledge to guarantee deposits in full.
There is no clear indication of what will happen to holders of Corpbank's dollar denominated bond, due to mature on Aug. 8.
The new government will have also to deal with the rising debt of public electricity provider NEK, after the outgoing government cut electricity prices twice last year and increased them only marginally in July.
"We are leaving the country with a stable fiscal reserve, which exceeds 8 billion levs ($5.5 billion), despite baseless talk of bankruptcy," outgoing Finance Minister Petar Chobanov told reporters in Sofia. "It gives room for flexibility."
Under its currency board which pegs the lev currency to the euro, Bulgaria is obliged to maintain a fiscal reserve. ($1 = 0.7425 Euros) (Writing by Matthias Williams; Editing by Jeremy Gaunt/Ruth Pitchford)