MONTREAL — After four games that amounted to a warmup in the World Women’s Cup, the United States team improved in the quarterfinals, then kicked its offense into gear Tuesday night in the semifinals.

The result was a 2-0 win over Germany at Olympic Stadium and a berth in the championship match Sunday.

Carli Lloyd scored on a penalty kick minutes after Germany misfired on its own penalty kick, and the veteran midfielder set up Kelley O’Hara’s insurance goal.

Team USA will meet defending champion Japan or England for the title. That semifinal is Wednesday night.

“We didn’t come into this just to get to the final, we’re in it to win the final, so we’ll be going for it all on Sunday,” Lloyd said. “I feel we have very good momentum going into it, and we’re confident we can do this.”

Lloyd put the United States up 1-0 in the 69th minute on a penalty kick after forward Alex Morgan was stopped cold by German defender Annike Krahn as she was entering the penalty area. Replays appeared to show Morgan was out of the box when the contact occurred, meaning a penalty kick shouldn’t have been awarded.

“I’m sad, because this penalty kick decided the match,” German coach Silvia Neid said. “But a referee’s decision is something one must live with.”

Lloyd netted her third of the tournament — and in as many games — by placing a shot to the right side while German goalkeeper Nadine Angerer dived the other way.

In the 84th minute, Lloyd took the ball toward the end line to the left of the goal, then cut the ball back to O’Hara at the goalmouth for an easy tap-in. It was O’Hara’s first goal for the national team.

“These are the moments I live for,” Lloyd said about shining on the big stage, which she often tends to do. “The coaching staff gives me a chance to express myself, and when that happens, I feel I need to respond accordingly.”

With the game still scoreless, German forward Celia Sasic, the tournament’s top scorer, missed a penalty kick in the 60th minute. She placed her low shot a few inches outside the left post.

American defender Julie Johnston drew a yellow card to set up Sasic’s effort. Johnston brought down midfielder Alexandra Popp in the penalty area, holding onto the German’s player left shoulder to avoid turning the ball over. The call was another that went in favor of the United States, as Johnston could have been handed a red card for denying an obvious goal-scoring opportunity.

Sacic’s goal count at the World Cup stayed at six.

The Americans (5-0-1) move on to play the final at BC Place Stadium in Vancouver, British Columbia. England and Japan will face off in the second semifinal at Commonwealth Stadium in Edmonton, Alberta.

Germany (4-1-1) will have to settle for Saturday’s third-place game in Edmonton.

“The two teams played nose to nose and neutralized each other,” Neid said, “but we didn’t follow through in terms of execution.”

Tuesday’s game pitted the top-ranked women’s team in the world, Germany, against the United States, second in the FIFA ratings. After each of the three previous meetings between the squads at the Women’s World Cup, the winner ended up capturing the title.

If that holds true this time as well, the United States women’s national team would end up being crowned World Cup champion for the third time in its history. The USA won the title in 1991 and 1999.

“It was a game between two terrific teams and Germany tested us, but we’re happy to be moving on,” U.S. coach Jill Ellis said. “I’m really proud of the players, they stepped up to the task.”

The U.S. team extended its unbeaten streak to 33 games (29-0-4) at the Women’s World Cup when scoring first. It also extended its goalless streak in the tournament to 513 minutes, and goalie Hope Solo could break the record in the next game. The mark of 540 minutes without allowing a goal at a Women’s World Cup was set by Angerer and Germany in 2007.

“This doesn’t just come from the goalkeeper and the back four, the entire team embraces the responsibility of defending on every line, ” Ellis said. “We ask a lot of them, but they understand that it’s important. And we do have a very gritty and sophisticated back line, which does a very good job of reading the play and shutting the opposition down.”

The U.S. streak came close to ending earlier, but the win was well-earned considering the Americans had the better scoring chances overall. Germany carried the ball deep into the U.S. half of the field on numerous occasions but was never really able to get behind the defense. The U.S. had five shots on target compared to only one for Germany.

“We did well to carry the ball to their end, but not as well at the goalmouth,” Neid said.

NOTES: Tuesday night’s game was Germany’s second at Montreal’s roof-covered Olympic Stadium following a win over France in the quarterfinals (1-1, 5-4 in penalty kicks) there Friday. … The American team was playing in Montreal for the first time at this World Cup after four games in Western Canada — two in Winnipeg, Manitoba; one in Vancouver, British Columbia; and one in Edmonton, Alberta — and moving East to Ottawa for its quarterfinal game against China on Friday. … USA midfielders Megan Rapinoe and Lauren Holiday and German defender Saskia Bartusiak were back in their respective starting lineups after missing the quarterfinals due to yellow-card accumulation. … German midfielder Dzsenifer Marozsan, who hyperextended her left ankle in overtime of the quarterfinal game against France, entered Tuesday’s game as a sub in the 78th minute. … Tuesday’s game was played before 51,176 spectators, the largest crowd for a game played in Montreal in the tournament.