A former immigration detainee has been wrongly charged with sexual assault in a case of mistaken identity by police.
The Richmond man was charged after a woman was allegedly assaulted and another person was allegedly stalked in the suburb in Melbourne's east on Tuesday, Victoria Police said on Thursday.
Detectives from the force's sexual offences and child abuse investigation team interviewed the man and charged him with sexual assault, stalking and two counts of unlawful assault, police said.
The man, who was released into the community following a landmark High Court ruling, fronted Melbourne Magistrates Court on Thursday and was remanded in custody after he did not apply for bail.
But he was called before court again in the evening after police realised their mistake.
The man was among detainees released following the High Court decision in November, which overturned 20 years of legal precedent to rule indefinite detention unlawful when there was no prospect of resettlement.
Almost 150 people were released in response after the decision and more than two dozen have been arrested since.
Police said the arrested man was not behind the alleged incidents at Richmond, with a magistrate saying the matter was a "misidentification".
She struck out the man's charges on Thursday evening.
Officers returned to a Richmond address on Thursday and watched CCTV, which they said showed another man who was the correct person of interest.
They were yet to track that man down as of Thursday evening.
Victoria Police Commander Mark Galliott said officers arrested the former immigration detainee based on his appearance, race, age, height, clothing and GPS data, which put him in the area.
He rejected the police error was a "blunder" but apologised for officers' mistake.
"Based on the information the investigators had at the time, they made the proper arrest, they made the right decision," Commander Galliott told reporters.
"It's through their diligence and the follow-up that they've actually uncovered what has occurred."
Commander Galliott said Victoria Police had not contacted the federal government about the mistake and the focus was instead on the investigation.
Immigration Minister Andrew Giles was earlier grilled in Question Time after the Richmond man's arrest and said people who breached their visa conditions would face the consequences.
"All our law enforcement agencies - the Australian Federal Police, border force and the state police forces as well - are doing an extraordinary job, and (I) express my confidence in them," Mr Giles told parliament on Thursday.
"I want to be very clear - and I think all members will appreciate this - that I am not in a position and I will not comment on any individual case."