The U.S. Justice Department has asked a federal judge to halt North Carolina's law requiring people to use restrooms corresponding to the sex on their birth certificates, citing the harassment of transgender people since the measure was enacted earlier this year.

The request for a preliminary injunction, filed late Tuesday, provides the most extensive look yet at the Justice Department's argument that the bathroom-access requirements violate federal law.

The filing comes just after North Carolina lawmakers left the measure largely intact during their session that ended Friday, all but ensuring that the measure's fate will be decided in federal court. Republican Gov. Pat McCrory had yet to sign their minor revision into law on Wednesday.

Pressure to change the law has come from business leaders, entertainers and the NBA.

The governor and legislative leaders say the law is needed to protect women and children from criminals who would pose as the opposite sex to enter restrooms.

But the Justice Department argues that a "growing consensus among federal courts," including a recent appeals court ruling, shows that the bathroom-access measure violates three federal laws — Title IX and Title VII, which forbid sex-based discrimination, and the Violence Against Women Act, which expressly prohibits discrimination based on gender identity.

The 4th Circuit Court of Appeals — which oversees North Carolina federal courts — ruled in April in favor of a transgender teenager in Virginia who was seeking to use the boys' restrooms at school.

In the North Carolina case, Justice Department lawyers argue that the appeals court's interpretation of Title IX aligns with their view that denying equal bathroom access to transgender people constitutes "sex discrimination."

"The legal conclusion that discrimination based on sex includes discrimination on account of transgender status is bolstered by an informed understanding of the real-life meaning of the term 'sex.' As both science and the Fourth Circuit recognize, an individual's sex consists of multiple factors, which may not always be in alignment," the lawyers wrote.

Lawyers for North Carolina's legislative leaders have dismissed the federal government's argument as a "radical theory." Their legal filing in May said "whether one is a man or a woman, and entitled to be treated as such, is an objective inquiry, driven by straightforward principles of anatomy and genetics."

The wide-ranging law approved during a special legislative session in March requires people to use the bathrooms in schools, universities and other state government buildings that correspond to the sex on their birth certificates.

It also excludes gender identity and sexual orientation from statewide antidiscrimination protections governing workplaces, restaurants and hotels; and overrules local antidiscrimination ordinances.

Entertainers including Bruce Springsteen canceled concerts in protest, scores of business leaders signed a letter seeking repeal, and the NBA commissioner said the state needed to make progress on changing the law to ensure the 2017 All-Star Game stays in Charlotte.

Rallies to support the law, meanwhile, have drawn thousands of conservatives to Raleigh.

The General Assembly revisited the law during its yearly legislative session, with lawmakers huddling privately to discuss changes. In the end, they chose to restore the ability of workers to use state law to sue over employment discrimination on the basis of race, religion, age and other factors, but left gender identity and sexual orientation unprotected.

Senate leader Phil Berger, R-Rockingham, insisted on the need to protect public safety "by keeping grown men out of bathrooms, shower facilities and changing rooms with women and young girls."

McCrory is pleased with the change he requested on workplace lawsuits, his spokesman said, but the legislation still awaited his signature on Wednesday.

The Justice Department says there's no evidence of such a public safety problem in 17 states and 200 cities or counties that have allowed transgender people to use restrooms matching their gender identity.

The Justice Department is suing the state, while McCrory and legislative leaders filed separate lawsuits to defend the law. North Carolina residents also sued, for and against the law.

The harassment complaints cited by the Justice Department include that of a 20-year-old student at UNC Greensboro who said he used men's restrooms without a problem until the state law passed. Not long afterward, the student, identified only as C.W., said he was stared down in a restroom by two men who used gender-related slurs.

Another case the department cites was reported by the psychologist of a patient — a transgender man — who said he was grabbed and forced out of a men's restroom in North Carolina in June.

"Shaken and scared, he then attempted to use a female public restroom in another location," the psychologist said in a legal filing. "He was then told he was in the wrong bathroom."