It was a hostage situation with a twist — and a happy ending.

A group of cranberry-pickers spent a night stranded on an island in a Russian swamp Wednesday after an encounter with a bear prevented them from leaving before dark, a ranger said.

Twelve people, including a pregnant woman, were harvesting the berries on an island near the town of Malaya Vishera, in the Novgorod region 280 miles northwest of Moscow, when a brown bear approached them, emergency official Sergei Orlov.

The pickers — most of them Gypsies, or Roma, from the area — set up a bonfire, shooed the bear away with shouts and called the mainland for help.

They had planned to leave the island but were afraid they would encounter the bear again if they left their makeshift camp, according to Vladimir Shikov, one of three rangers who arrived and spent the night on the island.

"There was a certain element of danger," Shikov told The Associated Press by telephone. But he said the bear was believed to be about three years old and was probably not mature enough to attack humans.

He said the rangers examined the bear's tracks to make sure it was not nearby, and took the people to Malaya Vishera — a town of 17,000 in a region whose swamps and forests are home to abundant wildlife, including bears.

Also in the Novgorod region Wednesday, a minibus hit a bear and two cubs on the main highway between Moscow and St. Petersburg, killing the mother and one of the cubs, the RIA-Novosti news agency reported.

Russia's bear population has increased in recent years as the amount of land under cultivation has decreased, with the human population dropping and youth leaving rural areas for cities.