The present invention relates to an environmentally friendly process for preparing rivaroxaban. The present invention provides a process for preparing rivaroxaban of formula I, the process comprising: reacting a compound of formula VI with a base in the presence of a solvent to form a compound of formula VII and condensing the compound of formula VII with a compound of formula VIII or a compound of formula IX in the presence of a solvent to prepare rivaroxaban of formula I, wherein the solvent used in both steps comprises water.