We prove that a necessary and sufficient condition for a countable set $\mathscr{L}$ of sets of integers to be equal to the algebra of all sets of integers definable in a nonstandard elementary extension of $\omega$ by a formula of the $\mathrm{PA}$ language which may include the standardness predicate but does not contain nonstandard parameters, is as follows: $\mathscr{L}$ is closed under arithmetical definability and contains $0^{(\omega)}$, the set of all (Godel numbers of) true arithmetical sentences. Some results related to definability of sets of integers in elementary extensions of $\omega$ are included.