The United States women's football team will play Brazil in Thursday's final after a dramatic 2-1 extra-time semi-final victory over Germany.
Lilly opened the scoring for the US before Germany equalised
Heather O'Reilly hit the winner nine minutes into extra-time after German substitute Isabell Bachor had equalised
Kristine Lilly's 33rd minute opener.
Brazilian striker Pretinha struck in the 64th minute of her team's clash with Sweden to wrap up a 1-0 win.
Pretinha fired home from a tight angle to atone for an earlier miss.
The Americans looked to have secured their place in the final thanks to Lilly's left-foot shot but Bachor cut inside to beat Briana Scurry with a deflected shot two minutes into injury-time.
O'Reilly then proved to be the hero for the USA, runners-up to Norway in Sydney four years ago.
Striker Mia Hamm, who retires after the Games with over 150 goals in more than 260 internationals, said: "We were a perfect team today.
"I am so proud to be on this team. We're ready to win the gold medal because we have such a confident team."