The law requires people to use public toilets that correspond to the sex listed on their birth certificate.
It also invalidated several local anti-discrimination measures that protected gay and transgender people.
North Carolina announced on Monday it would sue the Justice Department over its attempt to nullify the law.
"What this law does is inflict further indignity on a population that has suffered far more than its fair share," Attorney General Loretta Lynch said of transgender people. "We see you, we stand with you, and we will do everything we can to protect you."
The law puts North Carolina in direct conflict with federal laws prohibiting discrimination on the basis of sex and gender identity, said Ms Lynch.
"State-sanctioned discrimination never works and never looks good in hindsight."
The justice department is seeking a court order declaring the legislation, House Bill 2, "impermissibly discriminatory".
If the justice department wins the lawsuit, it would expand protections to transgender individuals under the federal Civil Rights Act.
North Carolina could lose funding for state universities if it upholds the legislation.
"I do not agree with their interpretation of federal law. That is why this morning I have asked a federal court to clarify what the law actually is,''  North Carolina Governor Pat McCrory said at a news conference on Monday.
He was responding to a letter from the Department of Justice asking that the state repeal or agree not to enforce the law.
"This is not a North Carolina issue. It is now a national issue," Mr McCrory said.
He said he hopes other states will join in to fight the justice department's argument that the Civil Rights Act ensures that transgender people may use toilet facilities matching their gender identities.
Supporters of the law say policies that allow transgender people to use toilets according to their gender identity increases the threat of sexual assault.
The US Justice Department has filed a lawsuit against North Carolina over its controversial anti-LGBT law, calling it "state-sponsored discrimination".