Gary Knell, President and CEO of NPR, speaks during a media tour of the new NPR headquarters, 1111 North Capitol Street NE, Washington, DC, June 18, 2013. (Evy Mages/FOR THE WASHINGTON POST)

Gary Knell, who wrestled with deficits during his 21-month tenure as NPR’s chief executive, said Monday that he was leaving the organization to take over as head of another Washington-based nonprofit media group, the National Geographic Society.

Knell’s departure continues the rapid turnover at the top of the audio and digital news outlet over the past few years. Knell took over the top job in December 2011 after the former chief executive, Vivian Schiller, had resigned nine months earlier amid fallout from two major controversies under her leadership. Schiller lasted just 26 months in the job.

At National Geographic, the venerable magazine publisher that has expanded into cable TV programming, Knell, 59, will replace John Fahey, who was president and chief executive for the past 16 years. Fahey, 61, is retiring as CEO but will remain chairman of the 125-year-old organization.

Knell’s announcement was a surprise to NPR employees, who had expected the former CEO of Sesame Workshop, which produces “Sesame Street,” to provide stability after NPR’s management upheaval. Kathryn “Kit” Jensen, the chair of NPR’s board, said the organization would begin a search for his replacement.

During his relatively brief tenure at NPR, Knell successfully battled to preserve public broadcasting’s federal funding and presided over the opening of NPR’s new $201 million headquarters building in Washington in April.

But he was unable to tame NPR’s operating deficit, which grew under his watch. Knell said in an interview that NPR will show about $6 million in red ink when its fiscal year is completed in September, on about $175 million in revenue. He said NPR is seeking to balance its books by 2015. So far, it has avoided the staff and programming cuts that preceded Schiller’s arrival.

During fiscal 2011, the most recent year available, NPR reported a deficit of $1.3 million, and a $5.2 million deficit in 2010.

Knell said that he had intended to renew his two-year contract with NPR when it expires in November but couldn’t pass up National Geographic’s offer.

“I think people are surprised, and some are disappointed” by the departure, he said, adding, “This was not something I planned to do.”

Both NPR and National Geographic declined to discuss current financial or salary data. Nevertheless, Knell is joining a larger and more financially stable organization. National Geographic reported revenue of $455.4 million in fiscal 2011 (the latest year that figures are available), with a surplus of $3.4 million. Its tax filing said Fahey earned $1.4 million in 2011, almost triple Schiller’s compensation the same year.

Fahey, in an interview Monday, said 2012 was the Society’s best year, financially, in its long history. “We’re in very good shape,” he said.

Under Fahey, National Geographic expanded into new areas, such as travel planning, and plunged heavily into TV programming. In a for-profit joint venture with Rupert Murdoch’s 21st Century Fox, it loaned its name to the National Geographic Channel. The channel — of which National Geographic owns about 30 percent — is now a formidable global entity, reaching 440 million cable and satellite homes worldwide.

In the process, it may have surrendered some of the prestigious image its yellow-bordered magazine had built up. Fahey has acknowledged that some of the channel’s most popular programs — such as “Inside the American Mob,” “Are You Tougher than a Boy Scout?” and the survivalist show “Doomsday Preppers” — aren’t always in keeping with the high-minded fare found in the channel’s namesake magazine.

Fahey said the Society’s next venture will be amusement parks with environmental and “learning” themes. He said the organization is close to signing deals with developers to build 15 such parks around the world.

In a memo to staff Monday, Knell called his decision to leave “difficult.” He said, however, that he was “offered an opportunity [from National Geographic] that, after discussions with my family, I could not turn down.”

Schiller’s tenure was beset by controversies over the firing of NPR analyst Juan Williams in 2010 and a video “sting” in March 2011 by a conservative activist, James O’Keefe, who secretly recorded an NPR fundraiser making disparaging comments about tea party activists while also questioning NPR’s need for continued federal funding.

Both episodes renewed calls in Congress to eliminate federal funding for public broadcasting. However, the
Republican-led effort was unsuccessful.

NPR said Knell will remain with the organization until the fall. National Geographic said Fahey will continue to serve as chairman of its board after Knell’s arrival.

Knell, who worked at Sesame Workshop for 22 years, including 12 as chief executive, has long had ties to National Geographic. He has been a board member of its education foundation and a member of the Society’s board of trustees for several years, and has known Fahey for the past 15 years.

The National Geographic Society, founded in 1888 by, among others, Alexander Graham Bell, publishes its namesake magazine each month in 40 languages. It also publishes National Geographic Traveler, National Geographic Kids, and National Geographic Explorer. The Society’s Web site gets about 27 million visitors a month, it said.