In one classroom monitored by security cameras, third- and fourth-graders read in Spanish from a short story about mice. In another, an algebra teacher reminds high school students to always fully distribute both sides of an equation before solving it.

On an artificial turf soccer field in the courtyard, sixth-, seventh- and eighth-graders are in the midst of a raucous kickball game — ignoring the high walls and surrounding 15-foot gate.

For about 200 immigrant children who fled to the United States with their mothers mostly from Central America it is another school day, except that they are housed in a federal immigration prison and all the residents risk being deported.

School is eight hours a day inside the federal immigration lockup at Karnes County Residential Center. The curriculum for pre-kindergarten to 12th grade is the same as bilingual schools across the state. Days begin with the reciting of the pledges of allegiance in English to the Texas and American flags.

Amid a surge of families and unaccompanied minors pouring across the U.S.-Mexico border, authorities converted what had been the all-male Karnes facility about 50 miles southeast of San Antonio to one with capacity for 532 women and children. They then teamed up a nearby charter school district to begin offering classes.

The Associated Press recently was allowed a tour, though U.S. Immigration and Customs Enforcement (ICE) didn't permit speaking with students or teachers, or on-the-record interviews with school administrators.

At Karnes detainees are allowed to move around the grounds, enjoying free Internet access, flat-screen TVs and a hair salon. Instead of guards, prison personnel are "resident advisers."

To prepare for families, the facility purchased three shelves of bilingual children's books for the library and painted cartoon murals, including an octopus with a platter in its tentacles in the all-you-can-eat cafeteria.

Still, some youngsters remain traumatized from the treacherous journey hundreds of miles north. School officials said that learning under such circumstances is difficult — but they say school can help children socialize and acclimate.

"Whether they stay here in the United States or go back to their home countries, they're here now and they're learning," said Enrique Lucero, who directs ICE's enforcement and removal operations in the region. "And that's valuable for their lives."

The Karnes facility is one of three nationwide housing immigrant parents and their children. The others are Leesport, Pennsylvania, and Artesia, New Mexico. The Leesport center offers schooling, while Artesia plans to begin classes in a few weeks.

One family in detention at Karnes is from Brazil and a few are from Mexico, but all others are from Guatemala, Honduras and El Salvador, where immigrants are fleeing street gangs and drug smugglers or extreme poverty. Many have sought asylum in the U.S.

Thousands of other children detained without their parents — comprising the bulk of the immigration influx — are processed differently. Many of those unaccompanied minors have already been released to live with relatives in the U.S. and have matriculated into ordinary public schools as their cases progress.

At Karnes, nine multipurpose rooms have been converted into classrooms, many adorned with patriotic posters of bald eagles and instructional pictures of different denominations of U.S. currency.

Upon arrival, children go through an assessment process and are placed in school based on academic ability — though officials say their grade level back home is often comparable to where they're assigned at the facility.

During AP's visit, 8 and 9-year-olds at round tables originally designed to play checkers read aloud from "El Mensaje del Ratón," or the "Mouse's Secret."

Nearby, 11th- and 12th-graders worked collectively in Spanish on an algebra problem written on a white board. The answer they came up was 6X+13x2. "Are you sure?" their teacher asked with a grin. "Si!" came the reply. But the class had forgotten a key set of parenthesis. The correct answer was 6X+6x2.

"Some of them may have missed a lot of school because of having fled, because of dangers. It's just not an easy endeavor." Said Michelle Brane, migrant rights director at the New York-based Women's Refugee Commission.

Brane pointed to an immigration facility outside Austin that once housed families but stopped in 2009 amid allegations of human rights abuses. There, students received just one hour of schooling per day.

"I have no doubt this will be better," Brane said of Karnes, which her organization is set to visit this week. "But just because it looks pretty decent on the surface, doesn't mean there won't be challenges."

Lucero said the children will remain at the Karnes facility until they are deported, or released on bond and allowed to live elsewhere in the U.S. with family or a sponsor pending upcoming immigration court dates.

In the meantime, they're days also feature physical education classes, such as the one that sparked the kickball game. It pitted a team called the Yankees against one known as the Eagles.

But when the Eagles won, the celebration involved the team's moniker in Spanish. "Aguilas!" its members whooped. "Aguilas!"

Follow us on twitter.com/foxnewslatino
Like us at facebook.com/foxnewslatino