Chancellor Dennis Walcott talks to teachers at M.S. 223 while principal Ramon Gonzalez looks on during a visit last week. M.S. 223 is working with nine teaching residents this year.

A program to train and keep new teachers inside some of the city’s most struggling schools is expanding to include better-performing schools as well.

The New York City Teacher Residency launched last summer at two schools that were receiving federal funds earmarked for overhauling struggling schools. The point of the program, city officials said at the time, was to create a talent pipeline for schools that have trouble attracting teachers.

But because the city and its teachers union did not agree on a new teacher evaluation system by a state deadline, the funds were cut off in January. The city is going forward with plans to double the size of the residency program anyway, but instead of sending new residents only to struggling schools, it is also directing them to schools that the city has touted as success stories. And it is picking up the bill out of the Department of Education’s regular budget.

The department opened the program to stronger schools in order to expose the teachers-in-training to a wider range of “best practices” and mentorship from experienced teachers, officials said.

“Think, what would it actually be like if these teachers were trained at a successful school instead of at a failing school?” said Ashley Downs, the special education director at M.S. 223 in the Bronx who is helping to mentor that school’s nine residents.

Chancellor Dennis Walcott visited M.S. 223 on the day before school started last week, telling teachers, “I think this is a tremendous school. You’ve had major accomplishments.” Two other schools newly receiving residents, Frederick Douglass Academy VII and Bushwick School for Social Justice, have also won accolades: FDA VII was honored for its success in helping to close the racial achievement gap for boys, and BSSJ is one of three schools on the campus Mayor Bloomberg visited last year to tout an increase in the city’s graduation rate.

The city did not abandon struggling schools. One school that now has teaching residents, J.H.S. 22 in the Bronx, also participated in the program last year. And some of this year’s crop of 56 new residents are assigned to two other schools that also received the federal funds, known as School Improvement Grants. They are Angelo Patri Middle School and Bread and Roses Integrated Arts High School.

Residency programs have been on the rise in New York City and across the country, as education officials increasingly view them as an expensive but effective way to prepare new teachers for challenging classrooms. They are seen as a more rigorous approach than that offered by alternative certification programs such as Teach for America and the city’s Teaching Fellows, which put new teachers in charge of classrooms after just a few weeks of training.

The residents work as teaching assistants for one year while pursuing masters degrees in education at St. John’s University, earning a salary of $22,500 and health benefits. They must commit to working in city schools for four years after completing the program.

Last year, the department used SIG funds to help foot the residency program’s steep bill: $1.3 million, or $50,000 for each of the 22 residents. In addition to paying residents’ salaries, the department pays mentor teachers $3,000 for each resident she supports, employs a program director, and subsidizes participants’ graduate school tuition.

This year, the Department of Education is shouldering the program’s increased cost centrally, according to Erin Hughes, a spokeswoman.

Downs said both the residents and the South Bronx middle school stand to benefit from the partnership. That’s because the residents will be learning from teachers with a track record of success, and M.S. 223 will have extra hands on deck, she said. Plus, she said, when the school looks to fill positions next year, some possible candidates will already be versed in M.S. 223’s culture.

M.S. 223 is expanding to include high school grades and agreed to take on residents under the condition that they could apply for jobs when the school adds a ninth grade in 2013.

Downs said she is already seeing differences between the residency program and other teacher training programs. For one, she said, the residents arrived before the start of the school year, so they got to watch experienced teachers set up their classrooms and take part in curriculum planning.

“If you walk in for the first time in October and the class is already running smoothly and the teacher’s just teaching the material, it seems like magic,” Downs said. “You don’t realize all the things that the teacher had to do to get the classroom to that point.”