Top executives at GM and Ally Financial enjoyed big pay days while their bankrupt companies struggled to repay the government in full for the bailout, a watchdog report said Wednesday.

The report blamed the Treasury Department for loosening the limits on executive pay that came as conditions to the bailout.

President Obama asked in 2009 that cash salaries be capped at $500,000, but the Treasury Department approved salaries that topped that amount for 16 employees at GM and its former financing arm, Ally, in 2013. In fact, the top 25 employees each received total compensation, including salary and stock, of at least $1 million that year, according to the report.

Treasury was too concerned with keeping companies competitive, disregarding the fact that the reason to keep them competitive was so that they could repay taxpayers in full, the report said.

Related: 15 top executives with $1 salaries

In a response, Treasury's Acting Special Master Patricia Geoghegan said the report contains many inaccuracies and omissions. She points out that Congress never established a cap on compensation. Instead the Treasury is supposed to determine that pay packages are "not inconsistent" with the public interest.

At the time, GM (GM) and Ally were the only companies left (out of seven) in the government's Troubled Asset Relief Program. The government sold its final stake of GM in December of 2013, but taxpayers came up about $10 billion short on the bailout.

In total, taxpayers invested $352 billion in the seven companies and recouped all of that, plus an additional $25.6 billion.