Gary E. Knell, the chief executive of NPR, announced Monday that he would be leaving the public radio organization to run the National Geographic Society.

His announcement came as an unwelcome surprise to NPR staff members, given that Knell brought some stability to the organization’s executive ranks when he was appointed in late 2011. Conflicts between past chief executives and the NPR board had resulted in repeated shake-ups in the years leading up to his arrival. But Knell’s departure is because of something else: a better job offer.

Knell’s two-year contract with NPR ends in November.

In an email to the NPR staff, Knell said he was approached by the National Geographic Society and “offered an opportunity that, after discussions with my family, I could not turn down.”

At National Geographic, he will succeed John M. Fahey Jr., who has been the society’s chief executive since 1998. Knell is already one of the 22 trustees of the society, which publishes National Geographic and other magazines, supports scientific research and expeditions, and jointly owns the National Geographic Channel.

“After a comprehensive and global search, we are delighted to announce that the perfect person for this crucial role was right in our own backyard,” said Jean Case, the co-chairwoman of the committee that searched for a new chief executive for the society. She said Farey would remain the chairman of the board.

While Knell’s departure from NPR appears amicable, it is disappointing to that organization’s board, which must once again search for a leader.

Ken Stern, who was named chief executive in 2006, stepped down less than two years later; an interim head took over until NPR hired Vivian Schiller away from The New York Times to run the organization in 2009. She resigned two years after that, after back-to-back controversies. Another interim head was appointed until Knell’s arrival in 2011 from the nonprofit Sesame Workshop.

In his message to the staff Monday, Knell said the NPR board “has been incredibly supportive of my leadership and is more than up to the task of finding a great successor.” The board could turn to one of Knell’s top lieutenants, like Kinsey Wilson, NPR’s executive vice president and chief content officer, or Margaret Low Smith, the senior vice president for news. Or it could look outside the organization, as it did when it brought in Knell.