Meghan Gleason, who used to be a government worker, is now working for KPMG. When sequestration hit Gleason’s agency, “there was a big question mark about what opportunities would be available for me.” (Matt McClain/The Washington Post)

Six years after candidate Barack Obama vowed to make working for government “cool again,” federal hiring of young people is instead tailing off and many millennials are heading for the door.

The share of the federal workforce under the age of 30 dropped to 7 percent this year, the lowest figure in nearly a decade, government figures show.

With agencies starved for digital expertise and thousands of federal jobs coming open because of a wave of baby-boomer retirements, top government officials, including at the White House, are growing increasingly distressed about the dwindling role played by young workers.

“Millennials are a very important constituency and talent pool to pull from,” said Lisa Danzig, associate director for personnel and performance with the White House’s Office of Management and Budget. Recruiting them, she acknowledged, “is a challenge. There’s a lot of competition for new talent among them.”

Danzig said that the federal shutdown, furloughs and pay freezes in recent years have eroded the attraction of working for the government. Just last week, the government came within hours of shuttering again before Congress approved an annual spending bill.

For those millennials who still want to land a government job, the hiring process can be an infuriating mystery. And the government’s Pathways internship program, designed to help launch young people on a federal career, is so beset by problems that only a trickle of workers has been hired.

Meghan Gleason, 29, abandoned her job at the National Institutes of Health last year. She had been hired in 2009 as a presidential management fellow under a marquee program for recent graduates with advanced degrees, and she rose to a management position at NIH’s clinical center in Bethesda, Md.

But then Congress imposed the automatic budget cuts called “sequestration.”

“I was starting to feel like I was ready for the next challenge” just as agencies imposed hiring freezes, Gleason said. Suddenly, she felt stuck. “I had fantastic mentors and teachers in government. But there was a big question mark about what opportunities would be available for me.”

She left NIH for a health-care consulting job at the accounting firm KPMG.

Overall, about a quarter of the American labor force is younger than 30, more than three times the proportion that works for the federal government.

After Obama became president, the administration fueled a brief hiring boom of young employees, but their share of new government hires has been tumbling, according to figures compiled by the Office of Personnel Management. At the same time, employees under 30 accounted for nearly 9 percent of those who left the government in 2013, a significant figure given their tiny presence in the workforce.

Budget cuts have forced agencies to slow the hiring pipeline in the past two years, and with job prospects in the private sector improving after the long economic slowdown, millennials are increasingly taking jobs outside government, where they can see a better chance of advancement. Millennials who want to try their hand at government work often find themselves having to compete with older, more experienced candidates — or older military veterans — who often are given preference in hiring, even for entry-level jobs.

“I had an idealized picture in my head of what it would be like to work for the government,” recalled Laura Freeze, 28, who started sending applications to USAJobs, the main federal jobs board, two years ago. She had received a master’s degree in public administration from Indiana University, taught English in China and worked for United Way as a VISTA fellow.

But Freeze got rejection after rejection, computer-generated form letters that she said would arrive six months after each application.

She gave up. Instead, she took a job with United Way, coordinating a tax preparation program that helps low-income people. While a post with the Internal Revenue Service might be a logical step in the future, Freeze said, “I don’t think I could go through that process again.”

Cheri Baker, 30, was a Peace Corps volunteer in Ghana. Her résumé is thick with fellowships, consulting jobs and a graduate degree in international development from the University of Denver.

She has applied for multiple jobs at the State Department and the U.S. Agency for International Development. “Everybody says, ‘You would be a great fit here,’ ” Baker said. She even moved to Washington in July to look for jobs in person. “I network really hard,” she said.

But she still can’t find a full-time position.

Danzig, the White House official, said part of the problem is that too many in government’s senior ranks believe that recruiting young talent is a task for human resources.

“Many government leaders don’t see it as their job to bring in new employees,” Danzig said. She added, “We want to get [leaders] more involved in recruiting.”

At the Office of Personnel Management, which oversee personnel issues for the federal government, top brass say they are making a push to hire millennials, who are often defined as people born between the early 1980s and late 1990s.

The agency’s director, Katherine Archuleta, has been visiting college campuses to urge students to consider federal careers. She selects colleges based on whether they have a large number of graduates in science, technology and related fields, which are a top priority, said Kimberly Holden, the agency’s deputy associate director for recruitment and hiring.

“We know hiring millennials is really critical to the future of the government,” she said.

Holden and her staff are identifying obstacles to getting top talent and overhauling USAJobs to make jargon-filled job descriptions clearer. They are studying social media as a vehicle to post jobs.

Meanwhile, the Obama administration has been working to revamp the Pathways federal internship program for college students and recent graduates. An earlier internship system, initially created by President Bill Clinton to attract “exceptional” people to careers in federal government, had run afoul of an oversight board that found it had circumvented proper hiring practices.

But the Pathways program continues to suffer from agencies’ poor training of hiring staffs, widespread confusion over who is eligible, and a weak system for reviewing a deluge of applications, according to a review by the nonpartisan Partnership for Public Service, working with the Volcker Alliance and Robertson Foundation for Government.

Two years after Pathways was relaunched, only a tiny number of interns have been hired, according to the Partnership for Public Service and several hiring officials. That means even fewer have been converted to full-time jobs. At the same time, some federal officials complain that the program undermines the traditional ways that agencies attracted talented interns.

“We had long-standing relationships with engineering programs in academia,” said Jeri Buchholz, chief human capital officer at NASA. “Pathways severed those relationships. We mourn the loss of them.”

At some agencies, millennials are trying to shake up the bureaucracy, challenging the pay-your-dues ethic and pressing for faster promotion opportunities and policies that strike a better balance between work and home. At the Department of Housing and Urban Development, for example, a group of workers with the agency for less than five years, calling itself Under 5, won backing for a program in which employees with innovative ideas are given four hours a week to work on them.

Anthony Cotton, 32, was initially skeptical of government work. Over and over, he had heard: “Their processes are too bureaucratic. This is where you go to make your career die.”

Also a former Peace Corps volunteer in Ghana, with a graduate degree from Fordham, Cotton decided to take a chance on USAID. “I found the office that sang to my values,” he said. Today, Cotton manages a small team, mostly under 35, that works with banks to secure micro-finance loans for small businesses in developing countries.

But even when millennials are willing to roll the dice on a government job, private companies and organizations hold an edge.

“The private sector can start recruiting during someone’s last year in grad school or when they’re a senior,” said Virginia Hill, the 32-year-old president of Young Government Leaders. Hill works in workforce development at NIH.

“They can promise a job,” Hill said. “Government can’t do that.”

And even Congress, though largely dysfunctional and held in low esteem by the public, can be a more attractive employer than a federal agency.

Millennials say they can have more impact working on policy for a member of Congress, according to Tom Manatos, who runs a job list for would-be Capitol Hill aides,

“People say, ‘My third or fourth year, I could be writing a bill for my boss,’ ” Manatos said. “You never hear them say, ‘I’ll go to the Department of Energy or HHS and get a great job at a nonprofit because of the work I did there.’ ”

Correction: An earlier version of this article said Anthony Cotton had a graduate degree from the University of Pennsylvania’s Wharton School. His undergraduate degree was from Wharton. He has two graduate degrees from Fordham University. This version has been corrected.