NOGALES, Ariz. — In a 120,000-square-foot warehouse on the edge of Nogales, Border Patrol agents line up hundreds of children to get basic vaccinations and other medical care, hand out snacks or join them for a game of basketball under a circuslike tent that doubles as a recreation room.

In a makeshift processing center, the children — all caught crossing the border in the Rio Grande Valley of Texas without parents — are housed for up to three days or more in nine holding pens: boys are separated from girls and older children from younger ones; teenage mothers and their babies stay in a cell of their own.

There is barely room to walk; mattresses line the concrete floor, which also has long bleachers bolted to it.

The children are being transferred to Nogales from Texas because a similar facility there can’t take any more.

Unlimited Digital Access. $1 for 4 weeks.

Customs and Border Protection officials said Wednesday that 900 children from Guatemala, El Salvador and Honduras were being held here, the newest arrivals in the clothes they wore on their trek to the United States, the others clad in white T-shirts and blue shorts, as in a reformatory. On one mattress, a girl wept, her face buried in a soiled stuffed lamb.

Chief Manuel Padilla Jr., the agent in charge of the Border Patrol’s Tucson Sector, said the agency’s goal was to keep the children “safe,” “healthy,” “nourished” and “clean,” and a lot had been done “to achieve these priorities,” sometimes in small ways.

When agents noticed the children were refusing breakfast burritos, which were made with flour tortillas, the kitchen switched to corn tortillas, like the ones used in Central America.

On Wednesday, the Border Patrol gave reporters a first glimpse of this center and a similar one in Brownsville, Texas, focal points in the national debate over the sudden stream of unaccompanied minors crossing illegally into the United States.

More than 47,000 unaccompanied children, most from Central America, have entered the country illegally since October.

From here, the children will be sent to juvenile-detention facilities around the U.S., where efforts will be made to release them to relatives in the United States on the condition they cooperate with deportation proceedings.

Rep. Candice Miller, R-Mich., vice chairwoman of the House Homeland Security Committee, called on the administration Wednesday to put the National Guard along the Texas-Mexico border.

And two Texas legislators — Sen. John Cornyn, a Republican, and Rep. Henry Cuellar, a Democrat — sent a letter to Homeland Security Secretary Jeh Johnson demanding answers to questions: Are the children tracked upon their release? Does anyone check to see if they have criminal records or gang affiliations?

In Nogales, the challenges of caring for the children are clear. There are three portable restrooms in each pen, and 60 showers in five trailers like the ones used by the Federal Emergency Management Agency in disaster areas. In the holding pens, there is no source of entertainment other than televisions with seemingly no sound or improvised games of soccer played in cramped corners.

Art Del Cueto, president of the Tucson chapter of the union for Border Patrol agents, said the agents were overwhelmed by the unexpected demands. “Catching illegal aliens is part of the job,” he said. “Processing is part of the job. But baby-sitting is not part of the job, and that’s what a lot of the agents have been doing.”

Material from The Associated Press is included in this report.