Comcast Corp. has been hit with a $2.3 million civil penalty by the Federal Communications Commission, closing an investigation into whether the company wrongfully charged customers for services and equipment they didn’t want.

The Philadelphia-based cable giant on Tuesday entered into a consent decree with the FCC in which it will pay the largest civil fine ever assessed to a cable operator and implement a five-year compliance plan including practices to obtain affirmative consent from customers, the commission said.