Under the deal, the Silver Ring Thing program won't be eligible for more funding unless it ensures the money won't be used for religious purposes.
"Public funds were being used to fund a road show, really, to convert teens to Christianity," said Julie Sternberg, an ACLU attorney.
She said the ACLU supports the program's right to offer religious content, but not with taxpayer money.
Joel Oster of the Alliance Defense Fund, which represented the program in court, said it was "pleased that abstinence-based sex education programs like Silver Ring Thing will continue to have the right to seek federal funding."
The Silver Ring Thing program, related to a Christian ministry based in the Pittsburgh suburbs, has received more than $1 million in federal funding during the past three years.
The program puts on shows at churches that include comedy skits, music videos and a message of abstinence. Young people are given a silver ring and decide whether they want to pledge to abstain from sex.
In its federal lawsuit in May, the ACLU complained that the ring was inscribed with a Biblical verse exhorting Christians to remain holy and refrain from sexual sin. It also alleged that group members testified how accepting Jesus improved their lives.
An attorney for the organization has said teens can chose between religious or secular programs and that the program's religious teachings have taken place separately from anything the government funds.
The government terminated the grant effective Jan. 31. A call to an HHS spokesman Thursday was not immediately returned.