Attempts to use machine learning to develop atmospheric parameterizations have mainly focused on subgrid effects on temperature and moisture, but subgrid momentum transport is also important in simulations of the atmospheric circulation. Here, we use neural networks to develop a parameterization of subgrid momentum transport that learns from coarse-grained data of a high-resolution atmospheric simulation in an idealized aquaplanet domain. We show that substantial subgrid momentum transport occurs due to convection and non-orographic gravity waves. The parameterization has a structure that ensures the conservation of momentum, and it has reasonable skill in predicting momentum fluxes associated with convection, although its skill is lower as compared to subgrid energy and moisture fluxes. The neural-network parameterization is implemented in the same atmospheric model at coarse resolution and leads to stable simulations. Overall, our results show that it is challenging to predict subgrid momentum fluxes and that machine-learning momentum parameterization gives promising results.