WINSTON-SALEM, N.C., Oct 18 (Reuters) - Transgender people would be allowed to use public restrooms in North Carolina that match their gender identity under a settlement agreement filed on Wednesday that aims to resolve the federal lawsuit over the state's widely criticized bathroom law.

The consent decree proposed by Governor Roy Cooper, the American Civil Liberties Union and transgender people who sued the state would remove some of the law's harmful effects, civil rights groups said.

The judge in the case must sign off on the proposal before it takes effect.

9 PHOTOS Protests against North Carolina transgender bathroom law See Gallery Protests against North Carolina transgender bathroom law ASHEVILLE, NC - JUNE 21: A display inside Malaprop's Bookstore/Cafe in Asheville, North Carolina features books by authors who support the repeal of HB2 on June 21, 2016. Malaprop's has had authors cancel and a decline in sales due to North Carolina's HB2 legislation, commonly known as the bathroom bill, and the resulting boycott of the state by authors, athletes and tourists. (Photo by Jacob Biba for The Washington Post via Getty Images) ASHEVILLE, NC - JUNE 21: A sign next to the men's bathroom inside Malaprop's Bookstore/Cafe in Asheville, North Carolina denounces North Carolina's HB2 legislation on June 21, 2016. Malaprop's has had authors cancel and a decline in sales due to North Carolina's HB2 legislation, commonly known as the bathroom bill, and the resulting boycott of the state by authors, athletes and tourists. (Photo by Jacob Biba for The Washington Post via Getty Images) ASHEVILLE, NC - JUNE 21: A bulletin board inside Malaprop's Bookstore/Cafe in Asheville, North Carolina features upcoming author visits and events scheduled for the bookstore on June 21, 2016. Malaprop's has had authors cancel and a decline in sales due to North Carolina's HB2 legislation, commonly known as the bathroom bill, and the resulting boycott of the state by authors, athletes and tourists. (Photo by Jacob Biba for The Washington Post via Getty Images) UNITED STATES - MAY 16 - Protestors gather across the street from the North Carolina state legislative building as they voice their concerns over House Bill 2, in Raleigh, N.C., Monday, May 16, 2016. House Bill 2, also known as the Bathroom Bill, which requires transgender people to use the public restroom matching the sex on their birth certificate, has received the attention of national media and the White House. (Photo By Al Drago/CQ Roll Call) UNITED STATES - MAY 16 - Protestors gather across the street from the North Carolina state legislative building as they voice their concerns over House Bill 2, in Raleigh, N.C., Monday, May 16, 2016. House Bill 2, also known as the Bathroom Bill, which requires transgender people to use the public restroom matching the sex on their birth certificate, has received the attention of national media and the White House. (Photo By Al Drago/CQ Roll Call) DURHAM, NC - MAY 10: The 'We Are Not This' slogan is posted at the entrances to Bull McCabes Irish Pub on May 10, 2016 in Durham, North Carolina. Debate over transgender bathroom access spreads nationwide as the U.S. Department of Justice countersues North Carolina Governor Pat McCrory from enforcing the provisions of House Bill 2 (HB2) that dictate what bathrooms transgender individuals can use. (Photo by Sara D. Davis/Getty Images) Elaine Martin, right, listens as Chris Sgro, executive director of Equality NC, speaks during a press conference to announce filing of federal lawsuit challenging North Carolina's HB 2 law at the LGBT Center of Raleigh on Monday, March 28, 2016. Several different advocacy groups and some of the lead plaintiffs spoke at the event. (Chris Seward/Raleigh News & Observer/TNS via Getty Images) Joaquin Carcano, center, the lead plaintiff in the case, speaks during a press conference to announce filing of federal lawsuit challenging North Carolina's HB 2 law at the LGBT Center of Raleigh on Monday, March 28, 2016. Several different advocacy groups and some of the lead plaintiffs spoke at the event. Joaquin was born a woman and is now a man. Simone Bell with Lambda Law is at left; Chris Brook with the ACLU is at right. (Chris Seward/Raleigh News & Observer/TNS via Getty Images) TO GO AFP STORY BY BRIGITTE DUSSEAU - Transgender delegates Jamie Shier (L) and Janice Covington pose for photographs at the Convention Center in Charlotte, North Carolina, on September 4, 2012. The Democratic National Convention Committee announced Wednesday that US President Barack Obama would move his acceptance speech from the outdoor Bank of America Stadium to the indoor Time Warner Cable Arena due to predictions of thunderstorms. AFP PHOTO / Mladen ANTONOV (Photo credit should read BRIGITTE DUSSEAU/AFP/GettyImages) Up Next See Gallery Discover More Like This HIDE CAPTION SHOW CAPTION of SEE ALL BACK TO SLIDE

North Carolina has been mired in litigation about transgender rights since Republican lawmakers enacted a law in 2016 that restricted bathroom choice in state-run buildings to the sex on people's birth certificates rather than their gender identity.

A measure passed in March rescinded the so-called bathroom bill known as HB 2 and helped bring back some business and sports events pulled from the state in protest. But activists said transgender people still faced discrimination under the new law, which left state lawmakers in control of bathroom policies.

The consent decree says that under current state law, transgender people are not prevented from using their preferred public facilities.

“For too many reasons, it is not in our state’s best interest to remain in drawn-out court battles that still linger because of HB 2,” Cooper, a Democrat, said in a statement.

Republican legislative leaders, who intervened in the court dispute, were not part of the agreement.

Cooper on Wednesday also signed an executive order that bars state agencies and those who have contracts with the state from discriminating on the basis of gender identity or expression.

Activists were pleased by both actions but said they would continue to fight for full nondiscrimination protections for lesbian, gay, bisexual and transgender people in the state.

“Nothing can make up for the cruel and senseless attacks transgender people have faced in North Carolina, but I am hopeful that the court will agree to clarify the law so that we can live our lives in less fear,” said Joaquín Carcaño, a transgender man and the lead plaintiff in the lawsuit.

20 PHOTOS The faces and stories of transgender people around the world See Gallery The faces and stories of transgender people around the world Penelope Patterson does a one-handed push up at his home in Brooklyn, New York, U.S. December 13, 2016. Jodie Patterson's 3-year-old, Penelope, was brooding and angry until one day she asked her child what was wrong. Penelope, who was assigned female at birth, was upset "because everyone thinks I'm a girl," but he said he was really a boy. "I said, 'However you feel inside is fine.'" Patterson recalled from their home in Brooklyn. "And then Penelope looked at me and said, 'No mama, I don't feel like a boy. I am a boy.'" Almost immediately, Patterson embraced the reality that Penelope was a transgender boy, and by age 5 he was going to school as a boy. Today, at age 9, Penelope is happy and healthy as a boy who loves karate and super heroes and decided to keep his birth name. REUTERS/Brendan McDermid Actress Laverne Cox walks in a Donna Karan creation during a presentation of the Go Red for Women Red Dress collection during New York Fashion Week February 13, 2015. REUTERS/Lucas Jackson (UNITED STATES - Tags: FASHION SOCIETY ENTERTAINMENT TPX IMAGES OF THE DAY) Charlie Lowthian-Rickert, 10, who is transgender, is kissed by her father Chris following a news conference announcing that Canada will introduce legislation to protect transgender people from discrimination and hate crimes, on Parliament Hill in Ottawa, Canada, May 17, 2016. REUTERS/Chris Wattie. TPX IMAGES OF THE DAY Joe Wong, 31, poses for photograph at his apartment in Bangkok April 3, 2015. Joe Wong, a 31-year-old transgender man from Singapore, underwent surgery to remove his breasts in 2007 and legally changed his name from Joleen to Joe. He had his uterus removed in 2009, and is legally recognised as a male. Wong is one of the many lesbian, gay, bisexual and transgender people in Asia who faced abuse and violence from his family. To escape the violence and find acceptance, many LGBT people migrate abroad - including Wong, who moved to Bangkok, where he currently works for the rights group, the Asia Pacific Transgender Network. To match Thomson Reuters Foundation Feature GAY-RIGHTS/ASIA Picture Taken April 3, 2015. REUTERS/Athit Perawongmetha Transvestite Tiffany, 19, shows a scar of a knife attack in Tegucigalpa March 10, 2011. According to leaders of LGBT organizations (lesbians, gays, bisexuals and transgenders), 34 people have been murdered in the last 18 months. The U.S. embassy and United Nations Programme on HIV/AIDS (UNAIDS) have requested the government to investigate the murders and safeguard the rights of the LGBT community, local media reported. REUTERS/Edgard Garrido (HONDURAS - Tags: SOCIETY CRIME LAW) Geraldine Roman, a transgender congressional candidate, (C) is greeted by her supporters during a "Miting de Avance" (last political campaign rally) for the national election in Orani town, Bataan province, north of Manila in the Philippines May 6, 2016. REUTERS/Romeo Ranoco Former Olympian Caitlyn Jenner arrives for the "Glamour Women of the Year Awards," where she was an award recipient, in the Manhattan borough of New York November 9, 2015. REUTERS/Carlo Allegri Chahat, a member of the transgender community, prepares for Shakeela's party in Peshawar, Pakistan January 22, 2017. REUTERS/Caren Firouz SEARCH "PAKISTAN TRANSGENDER" FOR THIS STORY. SEARCH "WIDER IMAGE" FOR ALL STORIES. Qian Jinfan, an 84-year-old transsexual who prefers to be addressed as "Yiling" holds up a photo taken at the age of 59, in the town of Foshan, in southern China's Guangdong province, July 6, 2012. Qian, who told Reuters during an interview that she always felt she was a woman and experimented with hormone cream, tablets and injections at the age of 60, is believed to be the oldest transsexual to live openly in China. The retired Chinese Communist Party official said she would not undergo a sex-change operation until it fully guaranteed her a female body that was complete with a woman's bodily functions. She admitted her days may be limited, but hopes that speaking to the media can help break down traditional assumptions and initiate discussions about transsexuals in society. About 2,000 people in China have undergone sex-change surgery and up to 400,000 could be considering one, according to a report in 2009 by state newspaper China Daily. Picture taken July 6, 2012. REUTERS/Tyrone Siu (CHINA - Tags: SOCIETY TPX IMAGES OF THE DAY) Tanya Walker, a 53-year-old transgender woman, activist and advocate, gives an interview at her apartment in New York City, U.S. September 7, 2016. Picture taken September 7, 2016. REUTERS/Brendan McDermid TPX IMAGES OF THE DAY Renee Richards poses for a portrait at her home in Carmel, New York March 25, 2015. More than three decades after putting down her tennis racquet, Renee Richards, 80, told Reuters she is still astonished she possessed the moxie to join the women's professional tennis tour after living the first 34 years of her life as a man. For all the frenzy around Olympian Bruce Jenner's reported decision to transition to a woman, the transgender pioneer Richards, born Richard Raskind, believes nothing could be tougher than what she endured in the 1970s. Picture taken March 25, 2015. To match Feature USA-TRANSGENDER/RICHARDS REUTERS/Mike Segar Helena Vukovic, Serbian first transgender veteran army officer, poses for a picture in Belgrade, Serbia September 7, 2016. REUTERS/Marko Djurica Nada Chaiyajit, a Thai transgender activist, 37, poses during an interview with the Thomson Reuters Foundation at a hotel in Bangkok, Thailand, November 28, 2016. Picture taken November 28, 2016. REUTERS/Athit Perawongmetha Transvestite Julio Yoaris Alvarez adjusts his brassiere while getting dressed at his home as the world celebrates the International Day Against Homophobia in Havana May 16, 2009. From an early age, Alvarez dreamt of having a sex-change operation and is currently awaiting his turn for one under the Cuban health care system. The surgery, like all other health care in Cuba, will be free of charge for applicants. REUTERS/Claudia Daut (CUBA SOCIETY HEALTH) Carly Lehwald sits with her son Ben at Carly's home in Chicago, Illinois, United States, May 30, 2015. Carly is Ben's father "Charlie", and transitioning to life as a woman is the basis for a new reality television show "Becoming Us". Picture taken May 30, 2015. REUTERS/Jim Young TPX IMAGES OF THE DAY TPX IMAGES OF THE DAY Anna Grodzka, Poland's first transsexual lawmaker, attends an introductory session to the Polish parliament for newly elected lawmakers in Warsaw October 24, 2011. REUTERS/Kacper Pempel (POLAND - Tags: POLITICS) Naz Seenauth, a transgender man, poses in New York October 22, 2014. Seenauth's driver's license says he is male. His birth certificate says he is female. The mismatch, he says, is deeply frustrating. New York City, where Seenauth was born and raised, does not accept that he is a transgender man and will not amend his birth certificate, for now at least, even though his doctor will attest to his gender. Picture taken October 22. To match Feature USA-NEW-YORK/TRANSGENDER REUTERS/Shannon Stapleton (UNITED STATES - Tags: HEALTH SOCIETY LAW) Damian Jackson (C), 51, shows family members his new documents after changing his officially registered gender from female to male, in the City Hall in Amsterdam July 1, 2014. Jackson is among the first to obtain new documents on Tuesday, when a new law came into effect, legalising the registration of a transgender person's preferred gender in official state documents, including identity cards and passports. It eliminates the previous law, which required hormonal treatment, surgery or sterilization before any change in gender registration is allowed. REUTERS/Cris Toala Olivares (NETHERLANDS - Tags: SOCIETY LAW) Audrey Mbugua, 31, Kenya?s most famous transgender campaigner, poses for a photograph in her garden in Kiambu, outside the capital Nairobi, March 31, 2015. Audrey Mbugua will not say whether it was a razor blade, pills or carbon monoxide that she used to try to kill herself. Born a male in Kenya and given the name Andrew, she felt trapped in the wrong body and started dressing in women's clothes while at university, attracting ridicule and rejection. After graduation, Mbugua was jobless, penniless and alone. Picture taken March 31, 2015. To match GAY-RIGHTS/KENYA REUTERS/Katy Migiro Randy Dolphin and transgender activist Veronika Lee-Tillman, who will be Grand Marshal in San Francisco's gay pride parade, are married during a ceremony at City Hall in San Francisco, California June 28, 2013. The couple was married at City Hall with San Francisco Police Chief Greg Suhr giving away the bride. The U.S. Supreme Court on Wednesday handed a significant victory to gay rights advocates by ruling that married gay men and women are eligible for federal benefits and paving the way for same-sex marriage in California. REUTERS/Robert Galbraith (UNITED STATES - Tags: POLITICS SOCIETY) Up Next See Gallery Discover More Like This HIDE CAPTION SHOW CAPTION of SEE ALL BACK TO SLIDE

(Reporting by Colleen Jenkins; Editing by Peter Cooney)