The hope of Nigeria's Dream Team VI of winning gold at the Rio 2016 Olympics has been dashed.
Germany's Lukas Klostermann tapped home the first goal in the 9th minute from close range, after Max Meyer beat Nigeria's defence, including goalkeeper Emmanuel Daniel, to make the pass.
A clear chance for Nigeria to equalise just three minutes later came when German goalkeeper Tim Horn accidentally tipped the ball to Sadiq Umar, but he failed convert the rare opportunity.
With two minutes to the end of the match, Germany coach Hrubesch Horst's replacement, Nils Petersen in the 77th minute diverted home a shot across goal that sealed Germany's victory.
Nigeria went into the match without the injured Oghenekaro Etebo, for the second match running, and also without Azubuike Okechukwu, who had been the team's captain until Mikel Obi took over at the Olympics.
Nigeria will now battle Honduras for bronze in their third place match Saturday, while Germany and hosts Brazil will fight for gold in the final.