UPDATE added May 29, 2018: The charges against the man in the following story were withdrawn in January 2018. Therefore CBC News has removed his name and photo from this story.

Calgary police have charged a 38-year-old man with sexually touching a woman without consent after he gained access to her apartment building last month.

Police say tips from the public led to the arrest of a Calgary man.

They had released photos of a male suspect, hoping to solicit information after the alleged Aug. 29 assault.

They told the public the suspect had entered an apartment building in the 1100 block of 6th Avenue S.W., and that he fled the building after sexually touching a woman who lived there.

Police believe this was a "random attack" as the man and woman did not know each other.

"It was a collection of unfortunate circumstances," Staff Sgt. Bruce Walker, head of the Calgary Police Service's sex crimes unit, said at a press conference Thursday morning.

Apartment security breached

The day of the assault, someone "allowed the door to stay open to allow him to gain access to the building," Walker said.

The man is then believed to have taken the elevator to break into the woman's apartment.

"It's very important with the large amount of population that we have in the downtown core, I think the apartment buildings, condos, businesses, [that] they have certain security protocols," Walker said.

"And those security protocols have to be followed."

On Tuesday, police searched a home in the 500 block of 6th Street S.W. Later that day, they arrested the man.

He has been charged with breaking and entering to commit sexual assault.

He's scheduled to appear in court Oct. 4.