A new law in the southeastern African nation of  Malawi that raises the minimum age for marriage from 16 to 18 is great for women and girls, but terrible for the country’s LGBT community, a global LGBT rights group said Friday. That's because the law defines all marriages, unions and cohabitation arrangements as being between a man and a woman -- and excludes gay, lesbian, bisexual and transgender people from legal protections, the rights group said.

Known as the Marriage, Divorce and Family Relations Law, the measure -- signed this week by President Peter Mutharika and expected to take effect Friday -- also defines a person’s sex or gender as the one assigned at birth, legally rejecting the gender identity of transgender and intersex persons, the International Gay and Lesbian Human Rights Commission said in a statement.

The United Nations, meanwhile, has praised the bill, noting that Malawi ranks No. 8 among countries with high rates of child marriage.

Across sub-Saharan Africa, 40 percent of women report having married as children, a Reuters report said. But while the U.N. and women's rights groups have spoken in favor of Malawi’s law, the global community has not been forceful enough in rebuking its anti-LGBT provisions, said Jessica Stern, executive director of the IGLHRC.

“It’s appalling that a law that attempts to address a serious human rights abuse like child and forced marriage would then also target Malawians for discrimination based on sexual orientation or gender identity,” Stern said. “It’s unacceptable to try to prevent one existing wrong and in the process create another abuse in the form of legal discrimination against LGBT [and intersex] individuals.”

Homosexuality is already illegal in Malawi, an ultra-religious and culturally conservative nation. But the new marriage law validates criminalization of gays by rejecting transgender identity and effectively banning same-sex marriages and families, Stern said in the statement.

The law won early support among feminist groups and nongovernmental organizations because of provisions it afforded women. The measure gives a widow a share of her husband's property, without the need for a written will, the BBC reported. The law also requires that underage couples who have children be supported financially by the male’s family, until the couple is able to live independently.