By Michael R. Gordon and Peter Baker

New York Times News Service

GENEVA — The United States, Russia, Ukraine and the European Union reached an agreement on Thursday evening that called for armed pro-Russian bands in eastern Ukraine to surrender the government buildings they have seized and that outlined other steps to defuse a crisis that has rattled the international community.

The diplomatic accord, while limited in scope, represented the first time Russia and Ukraine had found common ground since protests toppled a pro-Moscow government in Kiev, leading the Kremlin to annex the Crimean Peninsula and threaten other parts of Ukraine with 40,000 troops on its border. The deal came hours after Ukrainian security forces killed three pro-Russian activists in a firefight.

But neither President Barack Obama in Washington nor President Vladimir Putin in Moscow signaled that the crisis in Ukraine was over. During a long, televised question-and-answer session before the agreement was announced, Putin asserted historic claims over Ukrainian territory and the right to send in Russian troops.

Speaking after the agreement was announced, Obama sounded a skeptical note, saying it offered “a glimmer of hope,” but “we’re not going to count on it,” and adding that the United States would take more punitive action if Russia did not abide by its terms.

“My hope is that we actually do see follow-through over the next several days,” Obama told reporters at the White House, “but I don’t think, given past performance, that we can count on that, and we have to be prepared to potentially respond to what continue to be efforts of interference by the Russians in eastern and southern Ukraine.”

Hoping to coordinate a future response with European leaders, Obama spoke by telephone with Chancellor Angela Merkel of Germany and Prime Minister David Cameron of Britain.

Tension on the ground continued to mount in the hours before the Geneva agreement was announced. Pro-Russian protesters tried to storm a Ukrainian base in the eastern city of Mariupol, prompting a firefight that left three of the activists dead, 13 wounded and 63 captured, according to Ukraine’s interim interior minister. In Donetsk, where pro-Russian militants have taken over a government building, fliers appeared ordering Jews to register with authorities.

And in the hours after the accord, brokered in part by U.S. Secretary of State John Kerry and Foreign Minister Sergey Lavrov of Russia, militants occupying the government building in the name of the newly declared and wholly unrecognized People’s Republic of Donetsk said that they would not be bound by anything Russia had agreed to.