WASHINGTON — A federal appeals court upheld on Tuesday the government’s repeal of strict regulations for the companies that connect consumers to the internet. But the court also said the Federal Communications Commission had overstepped by broadly stopping state and local governments from writing their own rules.

The mixed ruling, by the United States Court of Appeals for the District of Columbia Circuit, ensures that debate about so-called net neutrality rules will continue, including in state capitals.

But over all, the decision Tuesday was a victory for the Trump administration, which has encouraged deregulation across the government. The F.C.C. chairman, Ajit Pai, who was appointed by President Trump, made the repeal of the rules a top priority, saying it would encourage innovation and help propel the economy.

The agency voted to throw out the rules in a 3-to-2 party-line vote in 2017, reversing a decision made during the Obama administration. The rules had prohibited broadband internet providers like Comcast and AT&T from blocking websites or charging for higher-quality service or certain content.