A patrolling garda arrested Ovideo Priu (30), a Romanian national with an address at Melford Road, London, at 2.30am on Thursday at Camden Street Lower.
Mr Priu was charged with two counts of sexual assault and appeared before Judge Cephas Power at Dublin District Court.
Garda Sean Murphy, of Pearse Street garda station, told Judge Power that the accused made no reply to the charges.
He objected to bail, citing flight risk concerns.
Gda Murphy said he was patrolling Camden Street Lower when he observed the offence and the woman “running from the accused”.
Gardaí obtained CCTV footage and later arrested and detained the accused for questioning.
The contested bail hearing was told he identified himself in the footage but made no admissions.
The officer said the accused lived in the UK and worked in London.
Questioned by defence counsel Garrett Casey, he accepted the accused would spend a lengthy period in custody pending his trial if the case were sent for trial to a higher court.
Mr Casey submitted that being held in custody in a foreign country was onerous for someone who was presumed innocent.
He told the court the defendant could reside in Dublin with a family member who would help him find work.
The barrister said Mr Priu would not leave the jurisdiction, adding that he “does not accept the charge”.
The court heard he had no prior convictions.
Regarding the garda claims of Mr Priu’s lack of ties to Ireland, counsel said his client had a Dublin-based relative in court.
Furthermore, the barrister suggested he could be bailed with conditions to regularly sign at a garda station and surrender his passport and national identity documents.
Gardaí must obtain directions from the Director of Public Prosecutions.
Judge Power noted the man had the presumption of innocence and some ties to Ireland, which could provide him with accommodation and work.
However, refusing bail, he cited the garda evidence of the woman “fighting off the accused” and the man being caught red-handed and that he resided in the UK.
Judge Power remanded him in custody to appear at Cloverhill District Court on Thursday. Legal aid was granted.