A group of fifth-graders in New Jersey were celebrating on Thursday after they won their battle to play mixed-sex basketball, thanks to a high-level intervention from the Catholic church.

The Archbishop of Newark has ordered that St John’s basketball team in the town of Clark be allowed back in their Catholic youth league – two weeks after the team were thrown out for contravening the rules on co-ed play.

St John’s made national headlines earlier this month after league officials gave them an ultimatum: go back to single-sex basketball, or have your results struck from the record. The Newark archdiocese claimed that league guidelines decree that girls and boys must play separately. Two girls played on the St John’s team.

The league’s decision sparked heavy criticism from players and parents – and a gesture from the boys on the team: they stood in solidarity, and refused to play on unless the girls were allowed back.

A standoff ensued, and the future of the team looked uncertain. In a showdown before a game last week, the league director told referees not to officiate if the girls played. But the team vowed not to give in – and now Cardinal Joseph Tobin, who was installed last month, has officially asked the league to let the mixed team play.

A letter published on Thursday by the archdiocese of Newark, under whose auspices the league is run, read: “Cardinal Tobin believes that the St John’s JV black team should not have been penalized for mistakes that adults responsible for following the league rules may have made.

“The cardinal has directed that the St John’s JV black team may retain its current roster as a co-ed team for the remainder of the current season, and have its win-loss record restored.”

Rob Martel, the St John’s coach and the father of one of the girls on the team, fought back tears when he heard the news. “Our season is going to continue as a team, and we’re going to the playoffs,” he told NJ.com.

Keisha Martel, the team’s assistant coach, said it was simply about basic fairness.

“This is all we ever wanted,” she said. “The cardinal and our pastor from the beginning supported us, and we understand that it was on the advice of counsel and the Catholic youth organization league director that the cardinal rescinded his decision. For him to overturn the CYO league director’s decision speaks volumes, and we are so grateful.

“This was never about being defiant or wanting to break, bend or change rules. It was about fairness for these 10-year-olds, about finishing the season the way they started – together.”

The archdiocese also said the Cardinal has asked officials to convene a group to “study the current league rules regarding participation and team makeup in all age groups.”