The man, who had been barred from the European Union's border-free Schengen area, was arrested in Giessen, near Frankfurt, late by police who checked his identity at the local railway station, the news weekly Der Spiegel and ARD TV channel reported .
German police and the public prosecutor's office in Giessen could not immediately be reached to comment on the reports. was a public holiday in Germany.
ARD said an SMS on the man's phone mentioned the name of one of the two El Bakraoui brothers, who blew themselves up in bomb attacks in Brussels.
The police also found another message, with the French word "fin"("end"), that was sent at (0808 GMT), two minutes before Khalid El Bakraoui detonated his bomb in the Brussels subway, der Spiegel said on its website.
Shortly before, his brother Ibrahim El Bakraoui was one of two suicide
bombers who blew themselves up at Brussels' Zaventem airport.
The arrested man had been in contact "with at least one person in the
(terrorist) group" in the hours before the attacks, ARD said without giving details.
The triple bomb blasts killed 31 people and left 300 injured. It was the worst terror attack in Belgium's history.