The three-judge panel rejected the previous map drawn by the Republican-controlled General Assembly, saying it violates the Equal Protection Clause, the First Amendment, and Article I of the Constitution.
The judges gave the state about three weeks to file a new plan with the court so it will be in place before the 2018 midterms
The opinion is the first federal court ruling to strike down a congressional map as representing a partisan gerrymander.
In 2016 two districts in North Carolina were struck down because judges said the map was racially discriminatory.
Ralph Hise, North Carolina's state Senate redistricting chairman, told Reuters through a spokeswoman that Republicans would appeal.
Judge James A. Wynn
of the 4th US Circuit Court of Appeals wrote the majority opinion. "...Partisan gerrymandering runs contrary to numerous fundamental democratic principles and individual rights," he wrote.
Dallas Woodhouse, executive director of the North Carolina GOP, directed his ire at Wynn, an appointee of President Barack Obama.
"This is a hostile takeover of the #NCGA and legislative bodies across the US," he tweeted. "It is incredibly disappointing activist Judge Jim Wynn is waging a personal, partisan war on North Carolina Republicans."
The head of the state's Democratic party applauded the decision.
"Today's ruling is a major victory for North Carolina and people across the state whose voices were silenced by Republicans' unconstitutional attempts to rig the system to their partisan advantage," Chairman Wayne Goodwin said. He called on the legislature to draw "fair, nonpartisan maps that give North Carolina voters a voice."
The case is not the only significant gerrymandering issue before the courts.
The US Supreme Court is considering a legislative redistricting case from Wisconsin
and later will hear a complaint from Republicans in Maryland.
The General Assembly is the bicameral legislature of North Carolina, consisting of a House and Senate. Republican lawmakers hold the majority in both houses and have enough members to override any vetoes by Democratic Gov. Roy Cooper.
North Carolina voting has been nearly split along partisan lines in recent statewide elections -- such as for governor and president -- but Republicans control 10 US House seats compared with three for Democrats.
The state has the 10th largest delegation in Congress.
Former US Attorney General Eric Holder, who has actively spoken against gerrymandering since the change of administrations, also called for "fair maps."
"Today's ruling was just the latest example of the courts telling state legislators in North Carolina that citizens should be able to pick their representatives, instead of politicians picking their voters," he said in a statement released by the National Democratic Redistricting Foundation.