Pro-Russian activists continued their defiant occupation of government buildings across eastern Ukraine on Friday, though some of their leaders said they would surrender weapons and pull back if the Ukrainian security forces also withdrew.

“We will lay down our weapons only if the National Guard and other Ukrainian military structures stop attacking us, and if we and our families feel safe,” Miroslav Rudenko, a leader of the pro-Russian militants in the Donetsk region, told Interfax news agency.

In the parliament in Kiev, Ukrainian Prime Minister Arseniy Yatsenyuk said Friday the new government was watching to see what the pro-Russian activists would do on the heels of an agreement forged Thursday in Geneva by diplomats that sought to defuse the crisis and included provisions aimed at stopping violence and provocative acts. The deal also called for all illegal groups to be disarmed.

The prime minister said parliament was ready to pass a bill that would grant amnesty to protesters who vacate occupied buildings and put down their weapons, but he said he did not have “unreasonable” expectations that the stalemate would quickly end.

“Russia had no other choice but to sign the statement and condemn extremism,” he said. “Having signed this statement, Russia effectively asked these “peaceful protesters” with Kalashnikov assault rifles and air defense missile systems to immediately disarm and surrender their weapons.”

On Thursday, Ukrainian forces engaged pro-Russian separatists in what appeared to be the most intense battle yet in restive eastern Ukraine, killing three militants and wounding 13 after what the Interior Ministry described as a siege of a military base.

“A mob of 300 militants, wielding guns, molotov cocktails and homemade explosives, attacked the Ukrainian military outpost in the city overnight,” Interior Minister Arsen Avakov said in a statement. The attack, he said, was repelled by National Guard and police in Mariupol, a southeastern city on the Sea of Azov.

After a “short battle,” Ukrainian commandos and counterintelligence units fanned out into the city by ground and helicopter in an operation to round up militants, Avakov said. He said 63 separatists have been detained in the operation, which he described as ongoing. Avakov reported no causalities among Ukrainian forces.

“Weapons, communication equipment and mobile phones were confiscated,” he said. “The identities of the detained persons are being established.”

Speaking at the parliament Thursday morning in the capital, Kiev, acting President Oleksandr Turchynov said the pro-Russian gang attempted to storm the base three times and carried automatic weapons, according to an Associated Press report.

Avakov said Ukrainian forces opened fire only after being attacked and firing warning shots in the air. “Following further warnings, they executed ‘shoot to kill’ instructions in compliance with their charter, after they were attacked once again,” Avakov said.

A dark YouTube video purportedly documenting the clash captured the sound of gunfire and militants hurling molotov cocktails into the outpost. Separatists yelled, “Go home, Bandera,” a reference to Stepan Bandera, a controversial World War II-era Ukrainian nationalist who collaborated with the Nazis and is seen as a symbol of the divisions between eastern and western Ukraine.

In Mariupol, a grisly tableau of bloodstains lined the scene beyond the ruined gates of the military base Thursday. A wrecked jeep — its windows and tires broken and its frame dented and partially crushed — rested in front of two military trucks being used as impromptu barricades. Remains of molotov cocktails were scattered inside the entrance to the base, where nervous young soldiers tried unsuccessfully to keep onlookers from gazing at the wreckage.

In the afternoon, the city remained calm, but tensions were high at the scene of the clash, where clusters of pro-Ukrainian and pro-Russian residents were engaging in heated arguments over the future of the country. Pro-Ukrainians accused some present of being on the payroll of local Russian operatives. One pro-Russian man, who gave his name only as Konstantin, was accompanied by a man carrying video cameras, who described himself as a journalist supporting the militants who have taken over official buildings in the eastern region of Donetsk.

Waving his finger, Konstantin, who said he had formerly served in the Soviet military, accused residents who support the Kiev government of being American lapdogs. “Don’t listen to them; they are trying to turn brother against brother,” he said, referring to Russians and Ukrainians.

“Why did they open fire? These were peaceful protests!” Konstantin continued. Moments later, however, he conceded that the pro-Russians who had gathered here last night had hurled molotov cocktails at the Ukrainian troops.

The base sits only a short distance away from the Mariupol City Hall, which was seized by pro-Russian militants last week and remained under their control Thursday. Eyewitnesses and military officials said the clash began at 7:50 p.m., when hundreds of pro-Russian activists — some in green camouflage and wearing balaclava masks — marched to the gates and demanded that the military surrender weapons that had been moved to the base for safekeeping from police stations around this port city.

Witnesses said the protest seemed to start peacefully, but by 8:30 p.m. local time, the crowd grew belligerent, throwing makeshift explosives over the gates and firing bullets. A 75-year-old who lives next door to the outpost and gave her name only as Klavdia said she heard a Ukrainian military official ask the crowd to disperse.

She said the soldier called out: “Please put down the weapons and molotovs. We don’t want blood.’’

But his warning was ignored, she said, and troops fired in the air. Enraged protesters soon stormed the gates, leading to exchanges of gunfire that left the bodies of dead and wounded strewn on the asphalt outside.

The Ukrainian military set up check points around Mariupol on Thursday, and newly arrived special forces were apparently seeking to identify the camps being used by pro-Russian militants. But there was no immediate sign of an attempt to raid the occupied City Hall, where anti-Kiev militants could be seen patrolling the grounds.

Ukraine is struggling to restore order in the eastern part of the country, where it says Russian special operatives are aiding local separatists in organized and well-armed occupations of official buildings in cities including Mariupol, a municipality of almost half a million people.

Ukrainian forces have seemed to be treading carefully, out of fear both of wounding civilians and of giving Russia a pretext to openly join the fight.

On Wednesday, a squad of separatists backed by seven masked gunmen in camouflage stormed the headquarters of Donetsk’s mayor and local council. By afternoon, more than 40 pro-Russian militants had occupied the building but were allowing officials to go about their business inside.

City workers shuffled to and from meetings under the watchful gaze of militants — many of them clutching automatic weapons — who loitered in the corridors. A few police officers strolled outside without attempting to intervene, evidence of the government’s tenuous grip on the region.

The militants said they are not connected with a similar group that occupied the regional headquarters in this city 10 days ago, but they issued at least one similar demand. They called for a referendum on May 11 with two questions: whether the populace agreed with the creation of a new Donetsk People’s Republic and, if so, whether it should be part of Ukraine or Russia.

“Why should we consider Russia a hostile state?” asked Alexander Zakharchenko, a commander of the militants at City Hall. “They are the closest people to us in the world.” He commands the Donetsk branch of a group called Oplot, a pro-Russia movement that started as a fight club of young men in the Ukrainian city of Kharkiv, to the north.

In this region of coal mines and machinery plants, where according to a local saying, “people work, not protest,” residents often tend to vote with their stomachs.

And there is no doubt that bread-and-butter issues are influencing the debate here. There are mixed feelings in the east, for instance, over the new government’s move to sign a trade deal with European Union that could lead Russia to slap higher duties on Ukrainian imports.