WASHINGTON (AP) — More than 1 million Americans await a hearing to see whether they qualify for disability benefits from Social Security, with the average wait nearly two years — longer than some of them will live.

All have been denied benefits at least once, as most applications are initially rejected. But in a system where the outcome of a case often depends on who decides it, most people who complete the appeals process will eventually win benefits. The numbers come from data compiled by the Social Security Administration.

About 10.5 million people get disability benefits from Social Security. An additional 8 million get disability benefits from Supplemental Security Income, the disability program for poor people who don’t qualify for Social Security. The disability programs are much smaller than Social Security’s giant retirement program. Still, the agency paid out $197 billion in disability payments last year.

Recipients won’t get rich as the average benefit is $1,037 a month — too small to lift a family of two out of poverty.

For some, the benefits come too late.

Chris Hoffman worked as a mason, laying bricks and tile and pouring concrete. He had terrible back pain for much of his life, but he kept working until a series of heart attacks. He applied for Social Security disability benefits in 2014 but was denied. He appealed to an administrative law judge.

In November, Hoffman died at 58, following his fourth heart attack. Ten months later, the judge ruled that he was entitled to benefits.

“It wasn’t that he was limited, it was that he wasn’t able to do anything,” said Hoffman’s son, Dustin.

Last year there were 7,400 people on waitlists who were dead, according to a report by Social Security’s inspector general.

For someone to qualify for Social Security disability benefits, a doctor must determine that the disability is severe enough to prevent an applicant from working. The disability must last at least a year or could result in death.

If applicants can’t perform their old jobs, officials see if they can adapt to new ones.

The Social Security Administration says it is working to reduce the backlog by hiring 500 new administrative law judges and more than 600 support staff. The judges, who now number about 1,600, hear appeals from people who were initially denied benefits. The agency is also expanding a program that quickly awards benefits to people with serious illnesses and conditions, including certain cancers, said Bea Disman, the agency’s acting chief of staff.

But advocates say budget cuts over the past five years have frustrated efforts to reduce the disability backlog.

Last year, the agency’s budget was $12.6 billion, roughly the same as it was in 2011, even though an additional 6 million people receive either retirement or disability benefits from Social Security.

“No search for efficiencies, reprioritization of tasks or technological improvements can substitute for adequate resources,” said Lisa Ekman of the National Organization of Social Security Claimants’ Representatives.

To get benefits, applicants first apply to state agencies that work with the Social Security Administration. These agencies approve, on average, about one-third of the applications they receive, Disman said. In most states, applicants who are denied benefits can ask the same state agency to reconsider, though very few of these applications get approved.

The next step is to file an appeal with an administrative law judge. This is where the backlog swells, with 1.1 million applicants waiting for a hearing before a judge. That’s slightly down from last year, but a 31 percent increase from 2012.

The average wait for a hearing is 602 days. Five years ago, it was less than a year.

The delay is an “unfair hardship for people already living with disabilities,” said Mike Stein, assistant vice president of Allsup, a firm that represents applicants.

Chris Shuler couldn’t attend his hearing.

Shuler was working as an airplane mechanic in Oklahoma when he was exposed to some chemicals and developed severe respiratory problems, said his wife, Elizabeth Shuler. The medicine he took for his lungs affected his bones and he eventually had two hip replacements, she said.

Chris Shuler applied for Social Security disability payments in 2012 and was denied almost immediately, his wife said. He died in July 2015 from an infection that started in his hip, just before his 40th birthday.

Four months later Elizabeth Shuler attended her husband’s hearing on his behalf.

“I wanted to make sure I at least saw a judge,” she said. “The judge said it was a no-brainer.”