German firefighters were deployed to remove an 18-year-old male after he broke into a detention facility in the northwestern town of Vechta, a prison spokeswoman said on Thursday.

The teenager apparently tried to reach his ex-girlfriend, who is one of the inmates inside the prison. The inmate had just ended the relationship with the 18-year-old over the phone.

Read more: Europe's 'most wanted' women fugitives revealed

Authorities believe the man used a lamp post to scale the 4-meter (13-feet) prison wall. In order to avoid getting snagged on the wall's razor wire, he preemptively removed most of his clothing, according to the public broadcaster NDR.

He then proceeded to climb the wall of the inmate housing building and reach the barred window of his ex-girlfriend's cell on the first floor. He was soon discovered by the prison staff but refused to climb down. Eventually, firefighters reached the prison and managed to remove the youth using an extendable ladder. The man suffered a minor injury in the process, according to the DPA news agency.

It was not immediately clear if the man's stunt, which took place last week, was successful in winning back the girl's heart. He is being investigated on suspicion of breaking and entering and illicit contact with a prisoner.

Authorities were taking measures to prevent another unauthorized entry, but refused to provide details. Citing unnamed sources, NDR reported that the lamp pole would likely be equipped with razor wire.