National security and defense firms, two of the most historically male-dominated fields, have emerged as surprising leaders when it comes to advancing women into senior leadership positions.

In a little-noticed recent announcement, CIA Director Gina Haspel promoted Elizabeth Kimber, who has been with the agency for more than 30 years, to head one of its two major divisions. As director of the Directorate of Operations, Kimber will oversee the recruitment of international spies and covert engagements, among other responsibilities. Women now occupy senior-level leadership positions in the Central Intelligence Agency, National Intelligence, Homeland Security, and the Federal Bureau of Investigation.

According to Tierney Remick, vice chairman and co-leader of Korn Ferry’s Board and CEO Services practice, government agencies are bringing an elevated commitment and focus to developing female leaders. “At the end of the day, they are making a concerted effort to create advancement opportunities for women and approaching it very strategically,” Remick says.

In the private sector, women now run four of the five largest defense firms in the United States—Raytheon is the lone exception. “The once male-dominated defense and aerospace industry has, in a few short years, blown up its own glass ceiling, elevating women higher and faster than most of the Fortune 500,” wrote Fortune upon the announcement of this year’s “Most Powerful Women” list. All four female defense leaders—Marillyn Hewson, CEO of Lockheed Martin; Phebe Novakovic, CEO of General Dynamics; incoming Northrop Grumman CEO Kathy Warden; and Leanne Caret, head of Boeing’s defense, space, and security division—made Fortune’s list.

The rise of female leaders in national security and defense firms mirrors the changing demographics of the US government itself. A record 117 women were elected to office during this year’s midterms, and women now represent 20% of the US Congress (a number that also underscores how far there is still to go to achieve equality).

Nels Olson, vice chairman and co-leader of Korn Ferry’s Board and CEO Services practice, sees another common thread among these women. “All of them were afforded very significant operational roles in which they showed a track record of tremendous success,” he says. Put another way, they got the necessary experience, such as operational roles with profit-and-loss responsibility, and were exposed to the right advocates and sponsors to champion them internally.

To be sure, government agencies took a page from their private-sector counterparts and put in place specific programs and processes to attract more women and help them with career development paths. Then they accelerated it by systematically exposing women throughout the talent pipeline to the multidisciplinary and multiagency roles necessary to be considered for agency leadership positions.

“Now there are roadmaps in place and pivot points where women can get exposure to the people and experiences they need,” says Remick. “They see a path to achieving their career goals that wasn’t there before.”

Sign Up for our 'This Week in Leadership' email