Water Polo Canada’s women are headed to the bronze medal match at the 2017 FINA World Championships after falling 12-10 to Spain in the semifinals on Wednesday.

Canada’s women played a resilient game from start to finish, but in the end it wasn’t enough to beat their Spanish opponents.

Spain caught an early lead in the game, setting the tone for the rest of it. The Canadian women, who were coming off a surprising win against Hungary in the quarterfinals, would spend the rest of the time trying to catch up.

RELATED: Water polo: Canada advances to semifinals at 2017 FINA Worlds in Budapest

The first quarter saw goals from Monika Eggens, who scored five of their six goals in their quarterfinal matchup against the host country, and Kelly McKee. Kyra Christmas and Shae Fournier pushed to close the gap before halftime to make the score 6-4.

Players of Canada react during the women’s water polo semifinal match Canada vs. Spain at the 17th FINA Swimming World Championships in Hajos Alfred National Swimming Pool in Budapest, Hungary, Wednesday, July 26, 2017. (Szilard Koszticsak/MTI via AP)

Into the third quarter, Spain continued their offensive streak from the first half, maintaining a three-goal lead throughout. The Canadians were able to answer back with a goal from Emma Wright and another one from Fournier to make it a 9-6 game.

A comeback seemed to be brewing in the fourth with hat tricks from both Fournier and Christmas as well as another goal from Eggens, but the Spaniards were able to close out the game with less than a minute to go for a final score of 12-10.

Next up, Canada will battle Russia for bronze on Friday, while Spain faces the USA for the gold medal.