The stout brick building with narrow windows looks from the outside like most other schools in Fairfax County. Inside, there are stark differences: There are no paper clips in the classrooms; scissors may only be handled with permission; and at the end of class, the students aren’t allowed to go home.

This is the school at the county’s Juvenile Detention Center, where freedom — and the future — for students lies beyond locked doors.

The jail’s educational program is a little-known entity within Fairfax County Public Schools, a place where troubled youths work toward high school diplomas and credit their teachers with saving their lives from ruin.

In a recent visit, detention center officials, teachers and students provided a rare glimpse into the education of young people who have run afoul of the law. It is a program that offers opportunity to youths with few options and that grants the students hope for better days ahead.

Francisco Ramirez, 18, who has spent about three years in the jail’s education program, said it has been extremely valuable because of the structure it provides his life. Expelled from Fairfax County schools and having struggled with drugs and family problems, he said he hopes to break away from his past with the help of education.

“If I was out right now, I’d be in a car driving around with my friends, under the influence,” Ramirez said. “I’m glad I’m here. I’m safe here.”

The center had 44 inmates on one day last week, juveniles whose alleged crimes included assault, drug possession and grand theft auto. The school’s principal, Eric Shaver, said about 500 to 600 students attend the program each year. For some of the inmates, the majority of their schooling occurs within the Juvenile Detention Center, where they are either awaiting trial or serving short sentences.

“These are beyond at-risk kids — these are kids in crisis,” said Shaver, 42. “But we believe in second chances. We believe in forgiveness.”

Like other teenagers in Fairfax County secondary schools, the inmates attend classes five days a week, studying science, math, art, history and English.

One difference, Shaver said, is that, compared with other schools, “we’ve got the best attendance in Fairfax County.” Enrollment for the inmates is compulsory.

Security is paramount inside the facility. Every door is locked. Cameras hang in every room. A small incident — such as a missing pen — can cause the entire building to be searched.

Students are supervised by counselors — the burly correctional officers who oversee daily life at the center.

Opened in 1982, the center is a county institution, but the school is funded through a grant from the Virginia Department of Education. The school’s 18 teachers are Fairfax County Public Schools employees.

Shaver said he recruits teachers who have the right background and experience. He said about half of the students are eligible for special education and about a third are learning the English language. The majority of the students are black and Hispanic, and many of the inmates are associated with gangs, Shaver said.

“I present it as challenge and opportunity to give back to a group of students who really need the best,” Shaver said. “They are not always the easiest to teach, but when you get past the rough edges, they are all likable kids.”

Todd Bell turned down a position at the prestigious Thomas Jefferson High School for Science and Technology to teach at the center. He said his students are focused in class — free from distractions like cellphones.

“It’s extremely gratifying when they come in believing they can’t do anything and leave here feeling that they can do far more,” Bell said. He also said that, for many students, the center is the most stable home they’ve ever known.

“They like knowing no one is going to sneak up on them at night and kill them while they sleep,” Bell said. “This is heaven to them.”

Newly elected school board member Ted Velkoff had not heard of the program until recently.

“I was just amazed, and pleased of course, that the county is doing these sorts of things,” Velkoff said.

One unit in the center is dedicated to a group of students that takes part in what is known as the “Beta” program. A judge sentences the students to serve six months in the therapeutic program while taking classes.

One Beta program student, who asked not to be identified because he was convicted of crimes as a juvenile, said he was arrested multiple times on charges ranging from stealing motorcycles to marijuana possession. He has served nine stints in the center, the longest period lasting seven months. He credits the Beta program with turning his life around.

“It’s helped me a lot,” he said. “I coulda got shot or something. I woulda been in a worse situation.”

Although he is 18, he studies at a 10th-grade level. He plans to work part time at a hardware store and to finish high school before enlisting in the military.

“Here I’ve learned skills to live on my own,” he said. “I have more respect for other people. I’ve learned to control my anger and to think before I act.”

Nancy Simpson, a literacy coach, has spent 12 years teaching at the Juvenile Detention Center and is among the longest-serving members of the faculty. Other teachers may get burned out and move on, she said, but those who stay feel gratified to see the students develop. Most of the students become avid readers, she said, because books are the only items allowed inside their cells. The “Hunger Games” series is especially popular.

Before arriving at the center, most of the students had never read a book all the way through, she said.

“I tell them that books can take them out of these walls,” Simpson said.

She said the teachers’ main goal is to help the students forget their troubles and focus on growing academically.

“They’re lost when they get here,” Simpson said. “They thrive here because they are treated with respect. They will get in your heart, some of them.”

Ramirez — who has had no contact with his parents in months — said the jail program offered him a stable life. In jail, he has had consistency and opportunity.

“I wasn’t used to three meals a day,” he said. “I don’t have to go a day when I can’t eat lunch because I don’t have any money.”

Ramirez was released from the program in May, leaving the school with one class left before receiving his diploma. His teachers considered him one of the brightest students in the unit. But he began using drugs again, violated his probation and was returned to the center in August. The Washington Post is not reporting his crimes because he was convicted as a juvenile.

He said he wants to finish high school and start taking business management classes at Northern Virginia Community College. But before he can get on with his life, he must first serve 30 days in the Adult Detention Center next door.

“I’m scared,” Ramirez said. “I don’t want to spend the rest of my life in jail.”