(AP)—A Costa Rican ban on in-vitro fertilization has been struck down by the Inter-American Court of Human Rights in a decision that reproductive health groups said could lead to greater access to abortion and some contraception in other Latin American countries.

The court said in a ruling late Thursday that a long-standing Costa Rican guarantee of protection for every human embryo violated the reproductive freedom of infertile couples because it prohibited them from using in-vitro fertilization, which often involves the disposal of embryos not implanted in a patient's uterus.

The court said that governments cannot give embryos and fetuses absolute protection under the American Convention on Human Rights. The Costa Rican government said it will comply with the court's decision and move to allow in-vitro fertilization.

The advocacy groups said they believed they now would be able to successfully challenge bans such as the total prohibition of abortion in El Salvador, Honduras, the Dominican Republic and Chile, which are based in part on the assertion of total protection of life for embryos and fetuses.

"This is a wonderful day for reproductive rights," said Alejandra Cardenas, a lawyer for the U.S.-based Center for Reproductive Rights, which filed briefs in the case.

Oriester Rojas said he was forced to travel outside Costa Rica with his wife to get in-vitro treatment and told reporters, "I hope that from now on everyone who's been affected by this can have the opportunity to turn their dreams of being fathers and mothers into reality."

Advocacy groups said most important was language about a guarantee of the right to life included in the American Convention on Human Rights, a binding treaty ratified by most countries in the Western Hemisphere and overseen by the Costa Rica-based rights court.

The article declares that the right to life "shall be protected by law and, in general, from the moment of conception."

The six-judge panel said in its ruling that "it is possible to conclude from the words 'in general' that the law's protection of life under said provision is not absolute, but rather gradual and incremental according to the development of life."

Cardenas said that a new case challenging, for example, a total ban on abortion would have to follow the standard that protections for fetuses are not absolute.

"They are always subjected to exceptions and must be proportional and incremental," she said.

Costa Rican Attorney General Ana Lorena Brenes told reporters, "We don't agree with it, but that doesn't mean that the country won't respect the judges' decision."

In-vitro fertilization was introduced to Costa Rica in 1996 by a doctor who helped couples give birth to 15 babies over four years. It provoked strong opposition from conservative groups and the Roman Catholic Church, which campaigned against the technique because it led to the disposal of fertilized eggs.

In 2001, 18 people brought a complaint before the Inter-American Commission on Human Rights after Costa Rica became the only Latin American country to bar in-vitro fertilization.

Costa Rican couples with enough money traveled to clinics in Panama, where hundreds of Costa Rican babies were born with the technique. One of the arguments the plaintiffs made before the Inter-American commission was that the ban was a form of discrimination against poorer families.

The human-rights commission ruled against Costa Rica and in 2010, after the failure of a congressional reform, the Inter-American Court on Human Rights took up the case, hearing testimony from both sides before issuing its binding ruling.

The regional court not only struck down the ban Thursday but said it was requiring Costa Rica to pay hundreds of thousands of dollars in compensation to the complainants and pay for in-vitro fertilization for low-income couples through its social security system.

The United States is one of 12 countries that have either not ratified the American Convention on Human Rights or have pulled out of it due to objections that it violates their national sovereignty.