Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The average pay for an S&P 500 CEO was $12.4 million in 2015, or 335 times the pay of a rank-and-file worker, according to a new report from the AFL-CIO.

That gap is actually narrower than the one posted in 2014, when CEOs earned $13.5 million, or 373 times the pay of the average worker.

Read More: Hard Times on Wall Street as Pay Cuts, Layoffs Loom

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The 2015 AFL-CIO Executive PayWatch compares average compensation of S&P 500 CEOs with the average pay of nonsupervisory workers as reported by the Bureau of Labor Statistics. Nonsupervisory workers earned $36,875 in 2015.

The survey also compared CEO pay to that of union workers. Here the gap between CEO and average worker pay was less at just more than 242 times, while the typical CEO earned more than 819 times what a worker earning minimum wage would take home in a year.

"The income inequality that exists in this country is a disgrace," AFL-CIO President Richard Trumka said in a statement.

With executive compensation increasingly tied to stock and stock option grants, executive pay has been trending higher for years in tandem with the stock market's performance. In 1980 the gap was much narrower, with CEOs earning 42 times what the average worker did, according to the report.

Read More: Why Corporate CEO Pay is So High, and Going Higher

This year's report also highlighted the companies with the highest levels of profits that are kept overseas, a practice critics say prevents the companies from paying higher U.S. corporate taxes.

The AFL-CIO maintains reinvesting those profits overseas is unpatriotic and said the $2.4 trillion held offshore could fund among other things, new hospitals, schools and fire stations at more than 7,900 communities.