A growing number of United States citizens have been detained under Obama administration programs intended to detect illegal immigrants who are arrested by local police officers.

In a spate of recent cases across the country, American citizens have been confined in local jails after federal immigration agents, acting on flawed information from Department of Homeland Security databases, instructed the police to hold them for investigation and possible deportation.

Americans said their vehement protests that they were citizens went unheard by local police officers and jailers for days, with no communication with federal immigration agents to clarify the situation. Any case where an American is held, even briefly, for immigration investigation is a potential wrongful arrest because immigration agents lack legal authority to detain citizens.

“I told every officer I was in front of that I’m an American citizen, and they didn’t believe me,” said Antonio Montejano, who was arrested on a shoplifting charge last month and found himself held on an immigration order for two nights in a police station in Santa Monica, Calif., and two more nights in a teeming Los Angeles county jail cell, on suspicion that he was an illegal immigrant. Mr. Montejano was born in Los Angeles.