education credits

I paid my daughters fall 2021 and spring 2022 all at once in dec. 2021. i got a 1098 from the college with the full amount I paid in dec. 2021 which was the fall 21 and spring 22.

i requested a withdrawal  just last week 3/1 from her 529 plan for that  same amount .

on my return it says I'm eligible to take either the lifetime learning credit or AOC but since i took out some from her 529 can i still take either of those credits? This is the first time I've had to do this