Police report that the man is now being investigated for attempted murder. They say that he pushed the 17-year-old girl into the Havel river in the west of Berlin before jumping in after her and trying to push her head under water.
But the man, who did not know how to swim, also swallowed large quantities of water.
The girl was able to free herself and made it to the river bank. When medics arrived she was suffering for mild hypothermia.
The young man, who arrived in Germany from Afghanistan in 2015, had to be resuscitated and was then brought to hospital. He was kept in the care facility overnight.
According to police, the two teenagers were once a couple. Investigators believe that the crime was motivated by a breakdown in the relationship.