Debutant Nico Schulz scored a scruffy 85th-minute winner as Germany claimed their first victory since their World Cup debacle by beating Peru 2-1 at the Rhein-Neckar-Arena.
Schulz's unconvincing attempt appeared to be heading wide of the target before Peru goalkeeper Pedro Gallese diverted the Hoffenheim man's drive into the net.
Schulz was one of those culpable for the Peruvians' goal, failing to stop Luis Advincula breezing past him down Germany's left before beating Marc-Andre ter Stegen from a tight angle.
Yet Joachim Low's men replied three minutes later through Julian Brandt's chipped finish, and Schulz's late winner ensured the Germans could start to look forward following their poor performances in Russia.
Germany started brightly as Marco Reus was denied inside two minutes by Gallese, who then stood up to keep out Matthias Ginter's free header from a corner, before Peru took a 22nd-minute lead.
Advincula was afforded too much space and neither Schulz, Niklas Sule or Germany goalkeeper Ter Stegen could prevent his near-post effort sneaking in.
Yet the hosts hit back quickly, Brandt cleverly lifting the ball over the advancing keeper after the Bayer Leverkusen winger was picked out by Toni Kroos' pass.
Both teams created chances in the second half - Timo Werner wasting Brandt's good work by firing over before Jefferson Farfan fired wide of the target when picked out by Advincula.
It appeared the game would finish level until Gallese's error, Schulz's weak side-footed shot squirming under him.
What does it mean: Germany can look to the future
This was not a convincing German victory, but it was perhaps fitting it was delivered by a debutant. The memories of Russia will take some shifting and new blood like Schulz can help this team move on.
Pat on the back: Brandt a bright spark
Germany lacked creativity and flair at the World Cup and Brandt is seen as one of those who can change that. He offered a directness few in Low's team possess and also showed a cool head to score in the first half.
Boot up the backside: Goalkeepers find it tough
Ter Stegen, brought in for Manuel Neuer, really failed to grasp his opportunity as he was beaten too easily for the opener. Yet that was not as bad as Gallese failing to keep out Schulz's weak try.
Having drawn 0-0 in their opening Nations League match with world champions France, Germany face Netherlands in the competition in October. Peru, meanwhile, have another friendly against Chile at the start of next month.