Everything depends on what the contract says. In Arizona AAR Residential Resale Real Estate Purchase Contract (lines 124-126) clearly state that "All assessments and fees that are not a lien as of the COE, including homeownerâ€™s association fees, rents, irrigation fees, and, if assumed, insurance premiums, interest on assessments, interest on encumbrances, and service contracts, shall be prorated as of COE" In case where the HOA fees have been delinquent for a long time and the HOA no has a lean on the property one has to be careful with lines 127-129 as there it will be indicated who will be responsible for it. The bank can sell an REO and the previous owner can remain responsible for past HOA fees.
If your bank is foreclosing on your home you do need some legal advise regarding this type of question. If you are in process of buying an REO and you have concerns about the delinquent HOA fees, work closely with your agent and title company to answer these questions. It you are just researching a potential pitfalls of buying and REO call me:
Coldwell Banker Residential Brokerage
9949 W Bell Rd Suite 101
Sun City AZ 85351