Armed men who allegedly held 12 suspected illegal immigrants in a Brownsville house for several days while trying to get money from their relatives were arrested Monday after a three-hour standoff with police.

The standoff — which began after one immigrant escaped and ran to a nearby home to call police — ended peacefully after police surrounded the home and negotiators diffused the situation, Brownsville Police spokesman Sgt. Jimmy Manrique said.

Three men were arrested. Two tried to mix in with the immigrants after the standoff ended, and S.W.A.T. members found the third hiding in a shed behind the house, Manrique said. Their identities weren't released.

The men were armed with handguns, but no shots were fired.

Ten men from Mexico and two women from El Salvador were turned over to Border Patrol for processing. They told police their captors had held them in the home for four days. They were hungry, thirsty and had swollen knees from being forced to kneel in a room, he said.

"They were being held against their will," Manrique said. "They were calling family members asking for more money."

Authorities across the border states are finding such cases where safe houses are converted from rest stops on immigrants' trips north to kidnapping hideouts where immigrant smugglers try to extract more money from their clients' families.

Manrique said the FBI will continue the investigation.

Brownsville is located on the southern tip of Texas, near the Mexican border.