Yes, you file as a U.S resident for the portion of the year ending on your "residency termination date". See the section of IRS Publication 519 at this link for more details.
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"