You cannot claim any of the
college tax credits, including the AOTC, based on expenses that were
used to calculate the tax-free portion of a distribution from a 529
college savings plan. The AOTC may be claimed in the same year that a tax-free
distribution is made as long as the same expenses are not used to
calculate the tax-free distribution AND the American Opportunity Tax
Credit.
For example, if you take $12,000 out of a 529 college savings plan to
pay for tuition you cannot use that $12,000 of tuition expenses to
claim the American Opportunity Tax Credit also.