In this, the most Russian city in Crimea, thousands danced and sang as a treaty was signed Tuesday wedding Crimea to Russia.

And in a Muslim cemetery outside Simferopol, the capital, hundreds attended the funeral of a Tatar last seen being taken away by men in military jackets after a protest.

The gleeful celebration by the majority, whose members think a historic wrong is being righted, and the grim ritual of mourning by members of a minority who are anxious about what comes next neatly summed up reactions to the new pact annexing Crimea to the Russian Federation.

Many details must be ironed out before it becomes official, but the transformation will happen quickly. In Moscow, lawmakers in the Duma said they could vote on the annexation this week. Ukrainian citizens in Crimea are being given a month to decide whether they want to become citizens of Russia or stay with Ukraine.

But even as Crimeans and Russians were feeling triumphant, shots were fired at a Ukrainian military base near Simferopol, underscoring the volatility of the situation.

A Ukrainian soldier was killed and an officer was wounded when assailants wearing no identifying insignia “stormed” the base, said Vladislav Seleznyov, a spokesman for the Ukrainian military stationed in Crimea and effectively surrounded by Russian troops and pro-Russian militias. It is unclear whether the two victims were struck by stray bullets or were targeted.

In a statement, Ukraine’s Defense Ministry said the assailants wore “military uniforms of the Armed Forces of the Russian Federation.” Ukrainian Prime Minister Arseniy Yatsenyuk said the conflict with Russia had moved from a “political to a military phase,” and the Defense Ministry said it had authorized its soldiers to respond with live fire in self-defense. But that contradicted reports from journalists on the scene, who said the assailants appeared to have been pro-Russian “self-defense” units that often work closely with Russian troops.

The incident did not stop revelers who drove around Sevastopol on Tuesday night, honking their horns in jubilation on a day many regard as a homecoming.

In the central square of a city that has been home to Russia’s Black Sea Fleet for more than two centuries, several thousand people watched a live broadcast of Russian President Vladi­mir Putin addressing legislators. They applauded loudly and often — particularly when he called Crimea inseparable from Russia and said its loss in 1954 was an “outrageous historical injustice.”

“We did it. We did it! We truly did it!” exclaimed Svetlana Kalinina, 53, tears rolling down her cheeks below her sunglasses.

Another woman, who gave her name as Natasha, kept repeating, “Thank you, Putin.”

“I have waited so long for this,” she said. “We were given away, like a sack of potatoes. And finally, we are coming back home.”

In Simferopol, reaction to Putin’s speech was more muted.

A furniture maker named Vladimir, 34, said that his business had plummeted during the recent weeks of frenzied campaigning but that he was “ready to starve for another year, as long as we will be with Russia and have peace instead of swastikas and disorder.”

But a man watching the speech in a cafe shook his head and frowned. “Putin’s words are eloquent, but I am not sure if this was legally correct or if Russia will follow through on its promises,” said the lawyer, 35, who gave his name as Alexander.

In his speech, Putin said no member of Crimea’s Tatar Muslim minority had been harmed in the reunification process and pledged that Tatars would be granted “full rights and political rehabilitation.”

Less than an hour later, mourners gathered for the funeral of Reshat Ametov, 39. The construction worker and Tatar activist had been missing since a March 3 protest. Relatives and other activists said Ametov was last seen being led away by three unidentified security men during a demonstration against annexation to Russia. His body was found Sunday in a forest about 25 miles away, reportedly unclothed and showing signs of violence, with his head and hands taped.

Tatar leaders said police had been unhelpful after the family reported Ametov missing. They described Ametov as a father of three who challenged local cases of corruption and abuse and raised Tatar issues on his Facebook page. They said they feared that his detention and killing were part of a new crackdown on Crimean Tatars, who strongly oppose becoming part of Russia.

“He fought for the truth, just like his grandfather fought for our freedom in the world war,” said a weeping woman at the funeral, who said she was an aunt. “He deserved a medal of honor, not to be killed at the hands of scoundrels.”

New York-based Human Rights Watch issued a detailed statement on the case Tuesday and called for a thorough investigation. The group said Ametov’s disappearance and killing illustrated a pervasive “climate of lawlessness” in Crimea. It urged authorities to disarm and disband “self-defense” groups that have proliferated recently.