The two injured victims, aged 45 and 68, were taken to nearby hospitals for treatment and their injuries were not life-threatening, a police spokeswoman said.
A 32-year-old suspect was later found injured at his apartment and arrested, police in the central German city said on Twitter.
The suspect, named by local media as Johannes L., had apparently harmed himself and was taken to hospital.
The motive was unclear, they said, but the suspect had a previous history of violence and psychiatric problems. There was no indication of a political motive.
Police had earlier deployed a helicopter and sniffer dogs after the attacker fled the scene.
He was said to be between 20 and 30 years old, wearing a brown jumper and dark jogging pants, with blond to reddish curly hair and a scarred face.
The attack came after a 24-year-old man on Friday went on a knife rampage in the city of Würzburg, stabbing three women to death and leaving six other people seriously injured.
The suspect, a Somali who arrived in Germany in 2015, struck in the city centre on Friday evening, first at a household goods store before moving on to a bank.
(article continues below)
See also on The Local:
He was then overpowered by police after they shot him in the thigh.
Investigators found records showing that the man had been treated at a psychiatric institution, and police said he was not a known Islamist.
But a witness account of the suspect crying “Allah Akbar” (God is greatest) during his killing spree fuelled questions over his motive.