Residents crowd outside a passport center to submit papers for getting Russian passports in Simferopol, Crimea. (Max Vetrov/AP)

Of course the leaders of Ukraine’s new government understood they were taking on the insurmountable when revolution delivered them into office less than four weeks ago.

They were set on reversing the course of Ukrainian history, bringing democracy to a country that had never known it, destroying corruption where it had always flourished, creating a modern economy from one still mired in the Soviet past.

And then it got worse.

On their first day at work in Kiev, armed men seized the parliament building on Ukraine’s Crimean Peninsula. By last week, Moscow had snatched Crimea and declared it part of Russia. Many Ukrainians feared that the eastern part of their country would be next. Europe and the United States looked on, struggling to find the sanctions that would restrain Russian President Vladimir Putin. A new Cold War was declared underway, and Ukraine was caught in the middle of it.

At least, as they’re saying here, World War III has so far been avoided. But what’s next?

“We had people ready to manage a normal country,” said Igor Burakovsky, head of a think tank, “but we found ourselves in abnormal circumstances.”

The new government is a temporary one, organized after then-President Viktor Yanukovych fled Kiev on Feb. 22, hours after he agreed with opposition members of parliament to leave office in December, when elections would be held.

Once he was gone, the opposition had to scramble, setting up the temporary government and scheduling a presidential election for May 25 — now only two months away. It’s still unclear who will run and whether leaders will emerge who can unite the country and inspire confidence among voters who have high expectations for change but no longer trust any politicians.

Internal dissent

Another challenge is keeping the country together. Over the weekend, several hundred demonstrators in Kharkiv, in Russian-speaking eastern Ukraine, demanded a vote on greater autonomy and self-government.

In Donetsk, another city in the east, pro-Russian crowds displayed signs urging Yanukovych to return and save them from a Kiev they consider out of touch with easterners and their needs.

No one here imagines that Russia has finished with them. There is widespread conviction that Putin will do everything possible to make the government fail. He has declared it illegitimate, and some fear that he will try to disrupt the election.

“Fair elections are crucial for Ukraine,” said Oleh Shamshur, a former Ukrainian ambassador to Washington. “But Putin doesn’t want a president elected by popular vote on his borders.”

His goal, they say here, is a deferential Ukraine.

“Putin hates Ukraine,” said Yuriy Shcherbak, a writer, politician and former Ukrainian ambassador to Canada. “We need to understand we’re in a state of war. Russia declared war against us.”

The new government arrived at work to find the treasury stripped bare — perhaps $500,000 was left — and billions of dollars in debts, a military that had been allowed to rust, no long-term defense plans and no structure capable of drawing them up. It was a dangerous period — the old government gone, a new one trying to find its way.

“The opposition wasn’t prepared to take power,” said Ihor Smeshko, former head of Ukraine’s Security Service. If Ukraine’s paratroopers and special forces had immediately been ordered to take back the parliament building in Simferopol, he argued, Crimea would have remained part of Ukraine and the two pro-Russian leaders would have been hustled off to Kiev. “I feel a colossal humiliation.”

The military and security services have been weakened by years of political rather than professional appointments, Smeshko said. Some government appointments have been made not on merit but rather to satisfy different parts of the coalition, he said. Many are uneasy that right-wing leaders have found prominent places in the government.

“What Ukraine lacks is a strategic plan for a year or two ahead,” Shcherbak said.

Dealing with corruption

The crisis over Crimea has prompted the rest of the world to invest time, money and expertise in Ukraine. On Friday, four months after Yanukovych refused to sign an agreement with the European Union in favor of closer ties with Russia — setting off the demonstrations that toppled him — the new government did so.

The E.U. has promised Ukraine $15 billion, with about $2 billion to arrive in a month or so. An International Monetary Fund mission is here until Tuesday, negotiating a package. President Obama has been pressing Congress to sign off on loan guarantees.

“We’re trying to bring Ukraine closer to Europe,” Alain Rémy, France’s ambassador to Ukraine, said last week. “But it must be a shared task.”

He said the E.U. expects the new government to disarm the militant groups that are walking around in many cities, including Kiev.

He said that more local self-government is crucial, local leaders must be elected instead of appointed and the fight against corruption “must be long-term, resolute and pervasive.”

“We have spent too much money for nothing in Ukraine,” Rémy said.

The next day, Interior Minister Arsen Avakov said he had detained Yevgeny Bakulin, head of Naftogaz — the national gas and oil company — as part of an investigation into corruption in the gas industry that had cost the country $4 billion.

“All we can do is move,” said Ostap Semerak, who as minister of the Cabinet of Ministers oversees government operations. “At a very fast speed.”

The Yanukovych government was famously despotic and corrupt. Police were under unofficial orders to solicit bribes, which had to be passed on to Yanukovych, said Burakovsky, head of the board of the Institute for Economic Research and Policy Consulting. Government revenue was divided into two streams, one for the inner circle and a smaller share for the state, he said.

Still, Semerak said, he was surprised to find the deposed president’s cooks and other numerous personal staff members listed on paper as high-level, well-paid officers in the government.

He must drastically cut the budget — the economy is expected to shrink by 3 percent this year — while finding money to build up the military to deter Russia.

Government officials now fly economy instead of by charter jet, a policy that saved $200,000 when Prime Minister Arseniy Yatsenyuk flew to Washington this month, Semerak said. Fleets of fancy cars are being sold. Former prime ministers are losing their offices, guards and full-time salaries.

‘We are the answer’

In February, during the last days of the confrontation between protesters and Yanu­kovych, nearly 100 people were killed, many by snipers. They are known in Kiev as the “Heavenly Hundred.” Russia has suggested that the opposition hired the snipers as a provocation. Demonstrators accuse Yanukovych, or perhaps Russian agents.

Citizens want answers, which they see as a test of the government’s competence and honesty. An investigation is underway, Semerak said.

Wendy R. Sherman, the U.S. undersecretary of state for political affairs, met here last week with some of the students who stood in the Maidan, as Kiev’s Independence Square is known, for months, demanding honest government. They talked about how Ukraine would overcome crisis.

“We are the answer,” she said they told her. “We have to make it happen ourselves.”