NEW YORK (CBSNewYork/AP) — Megyn Kelly, the Fox News star whose 12-year stint has been marked by upheavals at her network and personal attacks on the campaign trail, is headed to NBC News.

The move was first confirmed by Kelly’s publicist, Leslee Dart.

Kelly later tweeted and said, “While I will greatly miss my colleagues at Fox, I am delighted to be joining the NBC News family and taking on a new challenge.”

Kelly’s departure deprives Fox News of its second-most-watched host, behind only Bill O’Reilly.

Her contract with the network was due to run out this summer.

In the past two years, Kelly has weathered personal attacks from Donald Trump during his presidential campaign, and last summer she played a behind-the-scenes role in the ouster of Fox News founder Roger Ailes after multiple accusations of sexual harassment.

She is expected to take on a multi-faceted role at NBC.

(TM and © Copyright 2017 CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2017 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.)