The Spanish women's water polo team qualified for the semifinals and will compete for a medal after defeating Great Britain 9-7 on Sunday in the quarterfinals.

Maica Garcia scored with her head underwater with just 27 seconds to play to put the match away as Spain surmounted a late British comeback to reach its first women's Olympic water polo semifinal.

Britain had gone out ahead in the early going 2-1 but then Spain got things under control to score five uncontested goals.

The Olympic hosts staged a strong comeback, however, and with just 2:20 remaining the Brits were just one point behind at 8-7 before Garcia's goal sealed the Spanish victory.

Spain, the newcomer to the competition, will compete in the next-to-last round against Hungary on Tuesday, whom it had already beaten in the first round 13-11. The Spaniards controlled the play in that match at all times.

The winner of the Spain-Hungary match will play either Australia or the United States in the final. 

Follow us on twitter.com/foxnewslatino
Like us at facebook.com/foxnewslatino