The attack happened on a street in the city on Sunday.
Footage posted on social media showed three men assaulting a 21-year-old Ukrainian man and his 20-year-old partner, who was hurt trying to protect him.
Both victims were taken to hospital by ambulance; the woman needed stitches to her ear.
Police spokeswoman Aleksandra Freus told the Polish Press Agency (PAP) that "the start of the aggression was an argument in a queue in a shop, and later the men attacked a Ukrainian citizen on the street."
Investigators believe nationality played a role in the attack.
A third suspect is still being sought.
The 45-year-old was detained by counter-terrorism officers on a motorway as he tried to leave the city.
Wrocław police said one of the detentions happened "during dynamic operations, as the suspect tried to leave Wrocław and avoid responsibility."
Both men have extensive police records.
Interior Minister Marcin Kierwiński announced the detentions on X, saying "brutal violence will never go unpunished."
Wrocław's mayor, Jacek Sutryk, condemned the attack, saying: "There is not and will not be tolerance in our city for violence motivated by hatred, xenophobia or national prejudice."
He added that everyone has the right to feel safe in the city, whatever language they speak, wherever they are from and whatever they believe.
Ukraine's consul general in Wrocław, Taras Tokarskyi, had earlier called for a swift response from Polish law enforcement.
In a follow-up statement, he thanked the mayor for his condemnation of the attack.
The incident comes amid a reported rise in nationality-motivated assaults on Ukrainians in Poland, with police recording 180 such complaints in the first half of 2026, up more than 30 percent on the same period last year.
(ał)
Source: PAP