WASHINGTON -- The Internal Revenue Service has paid out more than a half-billion dollars in homebuyer tax credits to people who probably didn't qualify, a government investigator said Friday.

Most of the money -- about $326 million -- went to more than 47,000 taxpayers who didn't qualify as first-time homebuyers, said the report by J. Russell George, the Treasury inspector general for tax administration. Other credits went to prison inmates, taxpayers younger than 18 and people who did not actually buy homes.

"The IRS has taken positive steps to strengthen controls and help prevent the issuance of inappropriate homebuyer credits," George said. "However, many of the actions occurred after hundreds of thousands of homebuyer credits had already been issued, including fraudulent and erroneous credits totaling millions of dollars."

The popular credit provided up to $8,000 to first-time homebuyers and up to $6,500 to qualified current owners who bought another home during parts of 2009 and 2010.

The IRS said it worked hard to enforce a complicated tax credit that provided more than $27 billion to almost 3.9 million taxpayers. The agency said it corrected math errors on more than 370,000 returns and audited more than 400,000 taxpayers claiming the credit, denying hundreds of thousands of questionable claims. In all, the agency said its enforcement efforts saved more than $1.3 billion and identified more than 200 criminal schemes.

The agency questioned some of the inspector general's findings, but said it would follow up on the report and continue working to recoup any credits that were incorrectly paid out.

The tax credit for first-time homebuyers was part of President Barack Obama's economic recovery package enacted in 2009. In November 2009, Congress extended the credit and expanded it to longtime owners who bought new homes.

Homebuyers qualifying for the credit had until April 30, 2010, to sign purchase agreements. They had until Sept. 30 to complete their purchases, after Congress extended the deadline. The extensions and expansion of the credit created a complicated system that made it hard for many taxpayers to determine which credit they qualified for, if any. There were also income requirements.