A teenager who has been missing for two and half years has been found alive in a closet of a child pornography suspect in west Germany, police said.

The 15-year old boy was found on Friday during a police search in Recklinghausen, in the German state on North Rhine-Westphalia.

Police were searching a home of a 44-year old man suspected of distributing child pornography, when they stumbled on the boy.

"The officers discovered a boy in the closet. An investigation showed this was a 15-year old boy who has been missing for a long time," the Recklinghausen police said in a statement.

A spokesman for the police told CNN the boy had been missing for two and a half years.

According to the police, there was no indication that the boy was held in the apartment against his will. The boy remains under police protection and has not been identified for legal reasons.

More on 7NEWS.com.au:

The police spokesperson said the 44-year old man and another older man who was also in the apartment at the time were arrested.

On Saturday, a judge granted a request from the public prosecutor's office and issued an arrest warrant for a serious sexual offence against the younger of the two men, the police said in another statement.

The older man was released from custody.

During the search, a police sniffer dog trained to detect electronic devices found a number of data storage units in the apartment. The equipment is now being investigated, the police said.

In the video below: Supermarket drops Christmas card after distressing find