TUCSON — The federal checkpoints on highways near the Mexican border, with trained dogs and expensive scanning equipment, are supposed to stop drugs and immigrants without legal status from heading north. But newly released complaints against United States Customs and Border Protection paint a disquieting portrait of the interactions between agents and many of those they stopped and searched.

Drivers repeatedly accused checkpoint border agents of improper gunplay, racial profiling, excessive roughness and verbal abuse.

Last year, in southeastern Arizona, a military veteran said his children shuddered with fear in the back seat as agents repeatedly asked him if the children were really his. A woman at a checkpoint between Phoenix and Tucson said an agent threatened to use a stun gun on her brother in 2012 after he asked why their vehicle was being searched. And at a California checkpoint in 2013, a man said an agent approached him, hand on his holstered weapon, and demanded, “How would you like to have a gun pointed at your face?”

The accounts were culled from nearly 6,000 pages of complaints, arrest statistics and other records released in recent months to the American Civil Liberties Union of Arizona by Customs and Border Protection’s overseer, the Department of Homeland Security, after the A.C.L.U. sued the department for access. Collectively, the documents, detailing encounters between motorists and border agents from January 2011 to August 2014, portray an agency whose fractured oversight system has enabled at least some agents working along the southern border to stretch the limits of law and professional courtesy while rarely facing meaningful consequences.