A draw would have sent both through regardless of the result between Portugal and Ghana but, in the end, Portugal's narrow win sent the US through on goal difference.
Thomas Muller gave Germany the lead after the break with a superb measured finish from 18 yards out.
Jurgen Klinsmann's side were always in the contest but rarely threatened.