  The ground and a few excited states of the beryllium atom in external uniform
magnetic fields are calculated by means of our 2D mesh Hartree-Fock method for
field strengths ranging from zero up to 2.35*10^9T. With changing field
strength the ground state of the Be atom undergoes three transitions involving
four different electronic configurations which belong to three groups with
different spin projections S_z=0,-1,-2. For weak fields the ground state
configuration arises from the 1s^2 2s^2, S_z=0 configuration. With increasing
field strength the ground state evolves into the two S_z=-1 configurations
1s^22s 2p_{-1} and 1s^2 2p_{-1}3d_{-2}, followed by the fully spin polarised
S_z=-2 configuration 1s2p_{-1}3d_{-2}4f_{-3}. The latter configuration forms
the ground state of the beryllium atom in the high field regime \gamma>4.567.
The analogous calculations for the Be^+ ion provide the sequence of the three
following ground state configurations: 1s^22s and 1s^22p_{-1} (S_z=-1/2) and
1s2p_{-1}3d_{-2} (S_z=-3/2).
