RIO DE JANEIRO — Outrageous crimes happen with a certain frequency in Brazil. Bank robbery by way of a tunnel painstakingly dug from a nearby building is one favorite. ATMs are regularly ripped out of supermarkets and blown up, with mixed results. Dangerous criminals constantly fail to return to prison from holiday visits home (these are allowed, as are conjugal visits). Crime, in Brazil, can —and often does — pay.

But the daring robbery at a Samsung factory in Campinas in the early hours of Monday took the biscuit. An armed gang spent hours loading an enormous haul of cellphones, laptops and tablets onto a fleet of trucks, which then split off in different directions.

“They carried it off in approximately seven trucks and left the place with 40,000 products,” a spokesman for Campinas police told The Washington Post by telephone. Local media said $36 million worth of merchandise was stolen, based on preliminary reports. Samsung said Monday night that $6.3 million in goods were stolen and that just 50 employees were held.

Local media said nobody was hurt during the robbery, in which the gang of at least 20 armed men kept several employees under control for about three hours. TV Globo had CCTV images of the gang members, their faces hidden under hats and behind glasses, roaming the factory and loading crates onto trucks. Security guards had their weapons confiscated but, with a certain poetic irony, had been left guarding their positions.

The gang appeared to have entered the factory with remarkable ease. Police said the robbers hijacked a van carrying eight employees to work. They took an analyst and the driver of the van hostage. “They hijacked the van and entered the company with the van,” the police spokesman said.

Once inside, the gang split up and took control of employees. Police said they were armed with rifles but did not harm anyone. On the contrary, they seemed remarkably polite. One employee who was working in the factory canteen told TV Globo that his first inkling that something was wrong was when workers did not turn up for their meal. When the thieves loomed in a corridor outside, they told him to remain calm and took his cellphone battery.

“We are very worried about this incident,” Samsung said in a statement sent by e-mail. “Fortunately nobody was hurt. We have cooperated fully with the ongoing police investigation and will do our best to avoid any reoccurrence.”

A Samsung spokeswoman would not comment on a November report in the Folha de S.Paulo newspaper that said a cargo of Samsung cellphones had been stolen on a Campinas highway amid a wave of robberies. The newspaper said the area had become known as the "Bermuda Triangle" because of the robberies of electronic goods. It added that most of the cellphones were later recovered.

The post has been updated.