If a ball is hit in foul territory before first and third base and rolls fair is it a foul or fair ball?

Is the baseball is hit inside the batter's box or is hit in fould ground before first and third base then the ball is foul even if the ball comes back into fair ground. Thing to remember is once the ball hits any fould territory then it will be foul no matter what happens after the play.