School was a tough sell for Keybo Carrillo even before his eighth-grade teacher in Pennsylvania asked him, “Are you smart?” That moment a decade ago, he said, was when he totally lost faith in the system.

After getting into trouble, attending alternative schools, and giving up on school altogether, Carrillo came back to his home city of New York and only to find he couldn’t get the jobs he wanted without a high school diploma. On advice from friends, Carrillo gave school one more shot — a city program called Pathways to Graduation that prepares adults for the high school equivalency exam, known as the Test Assessing Secondary Completion or TASCTM.

“I said, you know what? I have to make a change,” said Carrillo, who attended a program for students who were previously involved with the court system.

Carrillo is one of about 2,000 students this year who graduated from Pathways, which is available and free for 18 to 21-year-olds who want to take the TASCTM, known formerly as the GED. Over the years, the city’s program has evolved past test prep and offers students connections to college and career opportunities, such as internships and professional training, said Tim Lisante, executive superintendent for District 79, which oversees programs for older students who have had interrupted schooling.

Like many students who choose Pathways, Carrillo was reserved at first and was clearly unaware of what he could do academically, said Brian Morris, one of his teachers. Many of Morris’ students are dealing with a host of issues — homelessness, trouble at home, recovering from substance abuse, readjusting to life after prison – and the biggest challenge for teachers is persuading them that they can cross the finish line.

“They go through a lot of things, so when they finally get to this point, it’s so incredible,” said Morris, who watched as Carillo and other Pathways students from the five boroughs graduated at United Palace in Washington Heights last week.

One woman walked while holding a young child on her hip as the crowd roared in applause. Another student who won an award needed the program to close out years of homeschooling. That student, 21-year-old Angela Rapp, took advantage of the program’s internship connections after passing her exam about a month after enrolling in Pathways and will study sociology this fall at Brooklyn College.

Looking ahead, Lisante said the education department is searching for ways to reach more students. By this September, he expects to have more nighttime options for those who enroll and to offer the program to students up to the age of 24, he said.

The program, Lisante said, has been growing steadily over the years, recalling when an auditorium at Hunter College was big enough for the graduation ceremony every year.

“Now it looks like we’re outgrowing this,” Lisante said as he looked at graduates crossing the stage.

As for Carillo, he credits most of his success to his teachers who “embraced” who he was — something he had never experienced before, he said. Carrillo, who earned a special award for his progress through the program, is now at LaGuardia Community College studying audio engineering.