Fox News is closing out 2017 with a lead over competitors MSNBC and CNN in both overall viewers and in the coveted 25- to 54-year-old demographic, according to Nielsen Research.

In the latest 2017 Nielsen ratings, Fox News topped MSNBC by 39 percentage points and CNN by 78 percentage points in overall viewers, HuffPost reported. In the 25-54 age demographic, the group most coveted most by news show advertisers, Fox News topped CNN and MSNBC by 27 percentage points with 488,000 viewers. CNN and MSNBC both had 370,000 viewers.

The network's success comes after a year of uncertainty and upheaval that has including the departure of well-known figures and schedule changes.

The conservative-leaning network lost two of its primetime hosts, Megyn Kelly and Bill O'Reilly, earlier in the year, causing a shakeup in the primetime lineup, HuffPost reported.

Kelly left in January for NBC News, where she is now hosting the third hour of the "Today" show, titled "Megyn Kelly Today." O’Reilly was ousted after a New York Times report revealed that he had settled multiple sexual harassment lawsuits, and advertisers fled his program Fox News host Tucker Carlson started the year in the 7 p.m. time slot, then moved to 9 p.m. after Kelly left, then to 8 p.m. when O’Reilly was ousted. Sean Hannity’s program moved from 10 p.m. to 9 p.m., and was replaced by conservative radio host Laura Ingraham at 10 p.m. The panel program "The Five" was moved to 9 p.m. when Carlson moved to 8. After Fox News host Eric Bolling was ousted by the network amid sexual misconduct allegations, "The Five" was moved back to 5 p.m. And Fox News anchor Martha MacCallum took over the 7 p.m. slot from Carlson when he initially moved to 9 p.m. The revolving schedules are hard to keep up with, but they show the power of Fox News and its loyal viewership. And these changes, largely due to hosts being ousted amid sexual misconduct allegations, has not diminished the network’s ratings, which appear to be immune from the scourge of scandal.

Fox New also topped its competitors in ratings for programing between 9 a.m. and 5 p.m. ET (dayside ratings). The network beat CNN in dayside ratings by 62 percentage points and MSNBC by 51 percentage points. While MSNBC gained 47 percentage points this year in the overall dayside ratings, and 33 percentage points in the 25-54 demographic, it was not enough to beat Fox News.

Hannity topped Maddow in his first week back at the 9 p.m. slot in September and went on to top Maddow in October to be the most watched cable news show.