GENEVA — The United States, Russia, Ukraine and the European Union reached an agreement here on Thursday evening that calls for armed pro-Russian bands to give up the government buildings they have seized in eastern Ukraine and outlines other steps to de-escalate the crisis.

Secretary of State John Kerry described the package of measures as an important first step to avert “a complete and total implosion” in eastern Ukraine and said that it could be followed by negotiation of more far-reaching steps to ease a crisis in which violence seemed to be growing by the day.

Mr. Lavrov said the deal was “largely based on compromise” and that a settlement of the crisis was primarily the responsibility of Ukraine’s. Mr. Lavrov made the remarks at a news conference that he gave before Mr. Kerry had spoken.

But President Obama sounded a cautious if not skeptical note in Washington. “I don’t think we can be sure of anything at this point,” he said, but there is a chance “that diplomacy may de-escalate the situation.”