A young Sri Lankan man has been arrested over the sexual assault of a female student at Macquarie University in Sydney's northwest.

Police say the 20-year-old student was asleep in a student accommodation building at the uni when a man broke into her room and indecently assaulted her about 3.20am last Thursday.

The woman woke up during the attack and the man fled.

Police say they arrested a 21-year-old Sri Lankan national at Railway Square in Sydney's CBD on Tuesday morning and took him to Surry Hills police station for questioning.

Macquarie University provides services for asylum seekers, including temporary accommodation, under a 2012 agreement with the Red Cross Asylum Seeker Assistance Scheme (ASAS).