In our attempts to achieve a detailed understanding of protein-silica interactions at an atomic level we have, as a first step, simulated a small system consisting of one alanine in different protonation states, and a hydroxylated silica surface, using a first-principles molecular-dynamics technique. The simulations are carried out in vacuo as well as in the presence of water molecules. In the case of a negatively charged surface and an alanine cation, an indirect proton transfer from the alanine carboxylic group to the surface takes place. The transfer involves several water molecules revealing an alanine in its zwitterionic state interacting with the neutral surface through indirect hydrogen bonds mediated by water molecules. During the simulation of the zwitterionic state the ammonium group eventually establishes a direct -N-H...O-Si interaction, suggesting that the surface-amino group interaction is stronger than the interaction between the surface and the carboxylic group. In vacuum simulations, the amino group exhibits clearly stronger interactions with the surface than the carboxylic group.