In the reaction below

ammonia + water ammonium ion + hydroxide ion
NH3(aq) + H2O(l) NH4+(aq) + OH-(aq)

Ammonia is the base because it gains a hydrogen ion
to become an ammonium ion.
Water is the acid because it gives away a hydrogen ion (to ammonia)
to become a hydroxide ion.

base + acid acid + base
NH3(aq) + H2O(l) NH4+(aq) + OH-(aq)

According to Lowry and Brønsted, water can be an acid or a base
depending on the substance reacting with it.