SpongeBob SquarePants and Snooki are coming back to DirecTV.

Cable programming giant Viacom and satellite broadcaster DirecTV reached a deal Friday morning, ending a nine-day battle that left about 20 million homes without more than a dozen popular channels including MTV, Nickelodeon, Comedy Central and VH1.

The dispute related to the fees that Viacom was seeking for its programming, which DirecTV viewed as a steep hike.

In a statement, DirecTV executive vice president Derek Chang said, "We are very pleased to be able to restore the channels to our customers and thank them for their unprecedented patience and support."

Chang went on to take a few shots at Viacom.

"The attention surrounding this unnecessary and ill-advised blackout by Viacom has accomplished one key thing: It serves notice to all media companies that bullying TV providers and their customers with blackouts won't get them a better deal," he said. He added that "it's high time programmers ended these anti-consumer blackouts once and for all and prove our industry is about enabling people to connect to their favorite programs rather than denying them access."

Viacom said in a statement: "Despite the unnecessary drama, we are very pleased with our agreement and are very thankful to have reconnected with our DirecTV viewers."

The short fight seemed to hurt Viacom more than DirecTV. Ratings for many of its cable networks saw declines of more than 20 percent during the blackout. Nickelodeon in particular took a beating as Disney Channel and other rival networks gobbled up viewers.

Terms of the deal were not disclosed, but both companies said it covers all of Viacom's networks. Not part of the deal is Epix, a pay movie channel that DirecTV claimed Viacom was trying to force it to carry.