Megyn Kelly (Victoria Will/AP)

Megyn Kelly, a star host at Fox News whose profile soared after a feud with Donald Trump, will leave the network for a prominent role at NBC News.

Kelly will host a daytime news and discussion program, anchor a Sunday-night newsmagazine show and be featured in NBC’s political programming and other big-event coverage, the network said Tuesday.

Kelly, 46, has been the host of Fox’s second-most-watched program, “The Kelly File,” and has been a breakout personality in the cable news landscape. Her departure will leave a big programming hole in Fox’s prime-time lineup, which has been anchored by her 9 p.m. program and Bill O’Reilly’s “The O’Reilly Factor” at 8 p.m.

Kelly has been hotly pursued by rival networks as her contract has approached its final months. Her value soared, perhaps inadvertently, when Trump criticized her for asking him about his attitude toward women during the first Republican presidential debate in August 2015. Trump continued to belittle her via Twitter throughout the campaign, despite a fence-mending prime-time interview special with him on the Fox broadcast network in May.

Fox News had sought to keep Kelly, reportedly offering her as much as $20 million to remain as host of her daily program — a $5 million-a-year boost over her current pay. Her contract at Fox runs through the summer, and it remains unclear when she will begin her new role at NBC.

The loss of Kelly creates even greater uncertainty at Fox, which has been rocked since last summer by multiple sexual-harassment allegations against Roger Ailes, its founder and former chairman. Ailes, who has denied the charges, was ousted in July after more than two dozen women — including Kelly and former anchor Gretchen Carlson — came forward with accusations against him. His departure was followed by that of longtime host Greta van Susteren in August.

(Erin Patrick O'Connor,Nicki DeMarco/The Washington Post)

Kelly’s complaints against Ailes, made public in her best-selling memoir, “Settle for More,” created tension within Fox, especially among her fellow news stars. O’Reilly suggested, without naming her, that she was being disloyal to the network by airing her experiences.

In October, she feuded briefly with Sean Hannity, saying that Trump was doing interviews with Hannity because he was afraid to venture beyond “unsafe spaces.” Hannity fired back on Twitter that Kelly was favoring Hillary Clinton. The two later posed for a photograph over the caption, “It’s complicated.”

The crossfire appeared to increase the chances that Kelly would leave Fox after 12 years, although Fox made clear that it intended to keep her. Rupert Murdoch, whose family controls Fox News and who stepped in as its interim chairman when Ailes left, told the Wall Street Journal this fall that money was not an obstacle in keeping Kelly.

Despite the tumult, the network had the most successful year in its history, with profits at record levels, thanks largely to increased viewership from its election-related coverage. During the year, it ranked as the top-rated network on cable.

Dan Cassino, a professor at Fairleigh Dickinson University who is the author of “Fox News and American Politics,” said Kelly’s likely replacement at Fox is former judge Jeanine Pirro, who hosts a weekend show on Fox, “Justice With Judge Jeanine.” Pirro is seen as “much more of a Republican team player, unlike Kelly, who has gone off the reservation on occasion, especially with regard to Trump,” Cassino said.

Other candidates could include Lou Dobbs or Maria Bartiromo, who now appear on the Fox Business channel, he said.

“Kelly’s departure does change the tenor of the network a bit,” Cassino said. “She was the most visible Trump skeptic on the channel, and when she leaves, she leaves a lineup that’s much more pro-administration than it was when she was there. That’s a bit of a branding problem for Fox, which would like to be seen as being more balanced, but it’s not likely to hurt them in the ratings.”

Since taking over a prime-time slot in 2013, Kelly generally has hewed to Fox’s conservative format but has often been less ideological than O’Reilly and Hannity.

Her departure from Fox follows more than 15 months of verbal abuse from Trump, who apparently never forgave her for her debate question about his characterizations about women. During the campaign the now-president-elect had called her “very hostile and unprofessional” and a “lightweight,” among other things, on Twitter, and retweeted several references by others calling her a “bimbo.”

In a brief statement, Murdoch said: “We thank Megyn Kelly for her 12 years of contributions to Fox News. We hope she enjoys tremendous success in her career and wish her and her family all the best.”