A 35-year-old local man was held by police after the attack in Northallerton on Friday night.
The assault happened in the area around the back of Barkers department store, on the High Street.
The man has been released on conditional bail pending further enquiries.
Police are appealing for witnesses to come forward.
DI Mark Pearson, who is leading the investigation, said: “This is clearly a very serious incident and we are doing everything we can to investigate and support the victim at this distressing time.
“As part of these enquiries, we are appealing for any witnesses to come forward. In particular, anyone who was in the area at the back of Barkers between 10.30pm and 11.30pm on Friday is urged to contact the police.”
Call 101 or contact Crimestoppers anonymously on 0800 555 111.